Error: Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-sun-1.6.0.26/lib/tools.jar

StackOverflow https://stackoverflow.com/questions/8851293

  •  28-10-2019
  •  | 
  •  

Pergunta

I am trying to build jasperserver on linux. It uses ant and maven. While executing the ant command it gives this exception. I checked on the same path however the lib folder is not there at the same path. How can I resolve this issue?

Thanks!!

Foi útil?

Solução

tools.jar is present only in jdk, not jre.

Outras dicas

I have fixed this issue by installing jdk..

Thanks to all for reply ..

I saw the same message running Ant after a JVM update. I fixed it by setting JAVA_HOME to JDK.

It could be that your eclipse is defaulting to your 32bit version of your jre. If you do everything right with JAVA_HOME set to C:\Program Files\Java\jdk1.6.0_21\bin and your running a 32bit version of eclipse you'll end up using something like C:\Program Files (x86)\Java\jre6\bin.

once you fix your jdk issue You will need to pass it on the end of a shortcut -vm "C:\Program Files (x86)\Java\jdk1.6.0_31\bin"

Or fix your JAVA_HOME

Other suggestions have been to make sure your eclipse is using the jdk not jre http://gamefromscratch.com/post/2011/11/15/Telling-Eclipse-to-use-the-JDK-instead-of-JRE.aspx

Just for others reference:By default eclipse will point to jre not jdk. if you want to change default jre please got to window -> Preferences -> Java -> Installed JREs
click on add button select Standanrd VM then set JRE home. here you can provide your installed jdk path it will look like below in case of windows. C:\Program Files\Java\jdk1.8.0_101

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top