Setting JAVA_HOME when running Ant from Java

后端 未结 5 504
生来不讨喜
生来不讨喜 2021-01-03 04:27

The reason is long and boring, but I need to run an Ant script to compile Java 1.5 code from a Java 1.4 app. I keep getting this error, though:

BUILD FAILED         


        
5条回答
  •  长情又很酷
    2021-01-03 05:10

    Another way to make this work is to add 'tools.jar' to your classpath. The javac compiler is contained within this jar.

    java -cp $JAVA_HOME/lib/tools.jar ...

提交回复
热议问题