2

While using Ant to build my application, the build is successful but at the beginning it says

Unable to locate tools.jar. Expected to find it in D:\Java\jre6\lib\tools.jar

However my tools.jar is at the location D:\Java\jdk6u30\lib

I understand that tools.jar contains classes needed by jdk and should only be present at jdk lib and nowhere else. I hope I am correct on this. My question is that why does build.xml expects it at a different location? I have my JAVA_HOME set to

D:\Java\jdk6u30

.

Supriya
  • 131
  • 1
  • 8
  • 19

1 Answers1

4

So by default eclipse will take the jre as installed JRE's when you add the server. Change the installed JRE's to jdk.

You can locate it from Window->Preferences->Java->installed JRE's

Tino M Thomas
  • 1,676
  • 2
  • 16
  • 24
  • Thank you. But I am getting this error when I execute some other command such as "deploywar" "D:\Workspace\Programs\ctcenterprise\build.xml:45: Unable to find a javac compile r; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "D:\Java\jre6". My JAVA_HOME is not set to the one it is taking. Also in my eclipse the path is correctly set. – Supriya Mar 02 '12 at 03:36
  • so you are saying that you set the JAVA_HOME to D:\Java\jre6 you should change the JAVA_HOME to jdk6. I mean the location you installed jdk6 – Tino M Thomas Mar 02 '12 at 03:41
  • I mean my JAVA_HOME was previously set to D:\Java\jre6 and later I changed it to D:\Java\jdk6u30 as my jdk is installed here. Also I changed it in eclipse as well. But still when I build the app using ANT it is pointing to the old location only. Why this behavior? – Supriya Mar 02 '12 at 03:47
  • Hey restarting everything helped. Thank you very much. The error is gone. – Supriya Mar 02 '12 at 03:49