Ant needs tools.jar and unable to find it

后端 未结 10 1914
温柔的废话
温柔的废话 2021-01-30 16:27

I am putting together a dev environment for a Java program and after the first try of my Ant build scripts I got this error:

Unable to locate tools.jar. Expected         


        
10条回答
  •  清歌不尽
    2021-01-30 17:11

    Try the following:

    % sudo apt-get install sun-java6-jdk

    % sudo update-alternatives --config java

    select the option that has the path

    /usr/lib/jvm/java-6-sun/jre/bin/java

    Worked for me on an ubuntu 10.4

    u can try to put your JAVA_HOME also, as follows:

    % sudo export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")

提交回复
热议问题