-2

I have tried everything like included tools.jar file in my classpath like

java -cp "C:\Program Files\Java\jdk.0.0.82\lib\tools.jar" SourceFile [ ( Paramters ) ]

Also i tried to copy tools.jar to my classpath where my binary files like javac, java, etc. are located but ToolProvider.getSystemJavaCompiler() is still returning null.

Please help me to make my code work.

Amedee Van Gasse
  • 7,280
  • 5
  • 55
  • 101
Mr. Suryaa Jha
  • 1,516
  • 16
  • 10

1 Answers1

0

Just copy tools.jar file from /lib to It works

You can obtain by System.out.println( System.getProperty( "java.home"))

Most of time it is like C:\Program files\Java\jre(version) [ for windows ]

Mr. Suryaa Jha
  • 1,516
  • 16
  • 10