ToolProvider.getSystemJavaCompiler() returning null

619 views Asked by At

I'm currently trying to compile and execute code at runtime. Everything worked perfectly fine in my IDE (Netbeans), but as soon as I exported my code as a .jar file ToolProvider.getSystemJavaCompiler() returned null. Is there a reason why this is working in Netbeans but not in the .jar file?

1

There are 1 answers

2
user207421 On

The compiler is only present in JDKs, not in JREs.