1

I get this error when i run EvoSuite

java.lang.RuntimeException: No Java compiler is available. Are you running with
the JDK?

A bit confusing, is it asking me to run with the JDK, or is it stating that i shouldn't?

When i run java -version it gives

java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
Viktor Mellgren
  • 4,318
  • 3
  • 42
  • 75

1 Answers1

1

You need to have JDK installed in your machine (and not just the JRE). This is because EvoSuite needs to compile and verify the tests it generates. If you have the JDK, but EvoSuite still does not find it, try to configure the JAVA_HOME system variable to point to it

arcuri82
  • 885
  • 1
  • 8
  • 17
  • Thanks, will try to fix my JAVA_HOME – Viktor Mellgren Nov 16 '15 at 10:02
  • just in case, also make sure that the PATH variable is taking the JDK from JAVA_HOME, eg something like PATH=$JAVA_HOME:$PATH (linux) or PATH=%JAVA_HOME%:%PATH% (windows). Otherwise, even if the JAVA_HOME is set, when running from command line you ll get the default JRE on the system – arcuri82 Nov 16 '15 at 14:09