javajvmjvm-hotspot

Compilation error Using jitWatch


I am not able to run jitwatch. It always returns me with compilation error.

Here is what I did:

git clone https://github.com/AdoptOpenJDK/jitwatch.git 
mvn clean install exec:java

enter image description here

Has anyone ever found a similar problem? How do we fix this ?


Solution

  • It looks like this method was added in Java 1.8, and I suspect the command line compiler that you're using is using a 1.7 compatibility flag (and thus not able to see the method). Check to see if you're specifying a different version of Java with an environment variable that Maven is using instead, or running with the -verbose flag to find out what the Java version used is.

    It looks like there's a Java 1.7 profile which is selected when the build thinks it's on a 1.7 runtime, and that might be a problem:

    https://github.com/AdoptOpenJDK/jitwatch/blob/master/pom.xml#L108

    So: check your Java version that's being used by Maven and investigate why it's not a Java 1.8 runtime.