I am trying to use the JavaCompiler class:
When I call ToolProvider.getSystemJavaCompiler() it returns null.
I think this is because I'm using a JRE instead of a JDK.
The problem is I want it to run on all platforms regardless of weather the user is using a JRE or a JDK.
If anyone knows how to fix this, or an alternative method to use please comment.
Any help would be appreciated.
ToolProvider.getSystemJavaCompiler() is not available.
Is tools.jar missing from the classpath?
Set class path to the tools.jar
file which can found in jdk\jre directory.
System.setProperty("java.home", "C:\\Program Files\\Java\\jdk1.7.0_02");