Centos cron run ant error "Unable to locate tools.jar" [duplicate] - java

I am building a project in Java.
I have this error:
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
I have installed a JDK and the folder: C:\Program Files\Java\jre6\lib is in my system but the file tools.jar is not there.

Yes, you've downloaded and installed the Java Runtime Environment (JRE) instead of the Java Development Kit (JDK). The latter has the tools.jar, java.exe, javac.exe, etc.

In case this is still an issue for anyone, I have a bit of clarification on the previous answers. I was running into this same issue using ant with only a JDK installed. Although, the JDK installer gave me a directory structure like this:
Directory of C:\Program Files\Java
05/08/2012 09:43 AM <DIR> .
05/08/2012 09:43 AM <DIR> ..
05/08/2012 09:46 AM <DIR> jdk1.7.0_04
05/08/2012 09:19 AM <DIR> jre6
05/08/2012 09:44 AM <DIR> jre7
0 File(s) 0 bytes
and when I ran ant, it complained about not finding tools.jar under the jre7 subdirectory. It wasn't until I set "JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04" that the error went away.

Install the Java SDK.
Add a System Environment Variable called JAVA_HOME with the value of JDK location.
Go to Control Panel\System and Security\System. Advanced System Settings, Environment Variables, System Variables, New... Example:
Variable Name:JAVA_HOME
Variable Value: C:\Program Files\Java\jdk1.7.0_21
Close/reopen your CMD window so that the new variable takes effect before attempting to re-run the ant command.

I had the same problem and copying C:\Program Files\Java\jdk1.6.0_26\lib\tools.jar to C:\Program Files\Java\jre6\lib\ext worked for me

If you have installed JDK 9.0.1 you will also have this problem as the tools.jar has been deprecated. See migration document.

Set your JAVA_HOME environmental variable to point to C:\Program Files\Java\jdk1.7.0_02.

If you are in Linux you can solve this by installing java on the system:
sudo apt-get install openjdk-7-jdk openjdk-7-jre

No, according to your directory structure, you have installed a JRE, not a JDK. There's a difference.
C:\Program Files\Java\jre6\lib
^^^^
It should be something like:
C:\Program Files\Java\jdk1.6.0_24

Don't spend too much time looking for tools.jar. If you get an error like that, don't be upset.
If you already have java JDK 1.5, go to your lib folder, and the tools.jar should be available there. Copy and paste it in your ant bin folder, then try to use the command ant -version.
You should see the expected result.

I had the same issue on a linux machine. I was quite frustrated at first, because I have installed both the JDK and JRE. I am using version 1.6, 1.7 and 1.8 simultaneously, and I have played a lot with the alternatives to have everything set properly.
The problem was quite stupid to solve, yet counter-intuitive. While I was using the correct JDK, I paid attention to the path of the tools jar maven complained about - it was expecting it to be
$JAVA_HOME\..\lib\tools.jar
The $JAVA_HOME variable pointed directly to my jdk folder (/usr/local/java which was also the correct $PATH entry and alternative sym link). It actually searches for the lib folder outside the java directory, because:
$JAVA_HOME\..\lib\tools.jar
will resolve to
/usr/local/lib/tools.jar
and that is not a valid location.
To solve this, the $JAVA_HOME variable should instead point to this location /usr/local/java/jre (assuming the JDK path is /usr/local/java) -- there is actually jre folder inside the JDK installation directory, that comes with each JDK. This new setup will cause maven to look at the JRE directory, that is part of the JDK:
$JAVA_HOME\..\lib\tools
which now resolves to
/usr/local/java/jre/../lib/tools.jar
and finally to
/usr/local/java/lib/tools.jar
which is where the tools.jar really resides.
So, even if you are indeed using the JDK instead of the JRE, the $JAVA_HOME has to point to the JRE. Remember, the OS alternative should still refer to the JDK.

go to your jdk path where you installed your java
For e.g In my PC JDK installed in the following path
"C:\Program Files\Java\jdk1.7.0_17\";
After go to the lib folder e.g "C:\Program Files\Java\jdk1.7.0_17\lib"
in the lib directory there is tool.jar file
Copy this file and past it in the lib forlder of jre7 directory
for e.g
"C:\Program Files\Java\jre7\lib"

You may face similar problem on Ubuntu:
Embedded error: tools.jar not found: /usr/lib/jvm/java-7-openjdk-amd64/jre/../lib/tools.jar
The problem is with JAVA_HOME that is not set properly.
So, on Ubuntu 14.04 x64 using Java8:
sudo apt-get install openjdk-8-jdk openjdk-8-jre
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

As many people mentioned, it looks like you are looking in your JRE instead of the JDK for the tools.jar file.
I would also like to mention that on recent versions of the JDK, there is no more tools.jar file. I downloaded the most recent JDK as of today (JDK version 12) and I could not find any tools.jar. I had to download JDK version 8 (1.8.0) here https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html to get the tools.jar file. I downloaded that version, took the tools.jar file and put it into my recent version's lib folder.

It's worth observing that tools.jar has been removed from the JDK since Java 9. https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-055EA9F4-835E-463F-B9E1-9081B3D9E55D
If people are facing this issue compiling a Java program with JDK 9+, you may need to review the dependencies of your projects.
In my case, I was trying to compile a project using AspectJ and the Maven plugin org.codehaus.mojo:aspectj-maven-plugin:1.11. After searching online, I found an alternative that supports Java 9+: dev.aspectj:aspectj-maven-plugin:1.13.M3.

I had the same problem even after installing Java JDK and set JAVA_HOME to ..\jdk1.6.0_45\bin folder.
Ant is still trying to find tools.jar in C:\Program Files\Java\jre6\lib folder.
I've fixed it by adding JAVACMD environment variable and set path for it to java.exe in the jdk folder.
In my case it was C:\Program Files\Java\jdk1.6.0_45\bin\java.exe

it has been solved with me in windows os by setting the JAVA_HOME variable before running as follows:
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111

Make sure that both the %JAVA_HOME% and %JAVA_HOME%/bin paths are added to your PATH variable.
All the answers about copying tools.jar into the correct position is a poor idea at best.
Make sure that your IDE can find these jars the way it was designed and intended for.

In eclipse window> preferences>Java> Installed JRE, I pointed the directory to the jre directory in the jdk 1.7 and i worked file for me
e.g C:\Program Files\Java\jdk1.7.0_71\jre

I had my JDK_path (C:\Program Files\Java\jdk1.7.0_79) in my JAVA_HOME and also the JDK_path\bin in my PATH. But, still my ant was using the JRE instead of JDK.
The issue was I had C:\ProgramData\Oracle\Java\javapathbefore my JDK_path in PATH variable. I simply moved my JDK_path before the oracle one and the issue solved.

solving this problem I have simply copied the tools.jar file from C:\Program Files\Java\jre1.8.0_112\lib to C:\Program Files\Java\jdk1.8.0_112\lib so that I have two tools.jar files instead of one and problem disappeared.

Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
if you have installed jdk then
..Java/jdkx.x.x
folder must exist there so in stall it and give full path like
C:\Program Files\Java\jdk1.6.0\lib\tools.jar

Make sure that your classpath is set correctly and pointing to the correct version of the JDK that you have installed. Also, are you using Open JDK? I have had this issue before after I tried to move from open JDK to Suns JDK. This is an example of how that issue could be fixed.

maven-compiler-plugin use jdk ,not jre,
tools.jar is in C:\Program Files\Java\jdk1.6.0\lib\tools.jar
you must config project JRE System Libary with jdk,not jar. This is the simplest solution.

Right click on your ant file
Go to "Run as" then click on "Ant Build..."
Go to the "JRE" tab
Select a JDK and not a JRE

For me what's working: I downloaded an old version of Java 1.7
I actually set my JAVA_HOME from C:/program files X86/Java BUT after I installed the 1.7 version I had another Java in program files/Java. And at this moment I found the tools.jar here. Then I changed for this new path and it's working

I was also facing the same error.
This was removed after setting Java_Home path to C:\Program Files\Java\jdk1.8.0_121.
Please ensure bin is not included in the path and no slash is there after jdk1.8.0_121 after you have defined %JAVA_HOME%\bin in the system path variable.

If you're in a RHEL environment the package name containing tools.jar would end with "openjdk-devel".

This is the solution for Windows: in Computer > Advanced system settings > Advanced > Environment variables..., add this in System variables:

I have downloaded tools.jar and after that I copied it into path in error message.
C:\Program Files\Java\jdk-11.0.1\bin > paste here tools.jar
After that I have restarted Spring Tool Suit 4 and everything was working.
When I was trying to fix that problem I have made new environmental variable:
Control Panel / System / Advenced / Environmental variables / new
Name : JAVA_HOME
Value: C:\Program Files\Java\jdk-11.0.1
But I do not know is it necessary.

maybe you have updated the JREs in the OS, and the addition has added in the "path" of the environment variables an entry ".../Oracle/jer" that overwrites your JAVA_HOME.
try to remove it from the "path" by leaving JAVA_HOME.

Related

eclipse open error failed to find main class in eclipse\\plugins/org...jar

at the beginning it says that failed to find java jdk or jre so i installed it. then i run it again it came up this.
It says that "Failed to find a Main Class in ... eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar"
java file are under
C:\Program Files (x86)\Java\jre1.8.0_31 && jre7
C:\Program Files\Java\jdk1.8.0_31 && jre1.8.0_31
my eclipse file are under
D:\迅雷下载\操作系统\eclipse
can someone tell me how to fix this ??
I was facing the similar issue where on launching eclipse photon it was giving error like:
Failed to find a Main Class in ...
eclipse\\plugins/org.eclipse.equinox.launcher*.jar
One of the reasons in my case was that I had two JDK versions on my system (JDK 6 & JDK 8).
It was running fine but stopped when I updated JAVA_HOME as JDK 6.
To rectify it, I added the below lines in the eclipse.ini file before -vmargs:
-vm
C:/Program Files/Java/jdk1.8.0_111/bin/javaw.exe
-vmargs
Basically, I passed the JDK 8 path to the eclipse as required version for eclipse photon was Java 8. And this got me working.
Try to move eclipse to some simpler path, like D:\development\eclipse
This error is due to because you might have downgraded the version of java in your environmental variables.Try changing the java version in environmental variables and then run the sts or eclipse..for better practice restart the system.hope it helps.!!
I do not mean to steal the first answer - it did help me solve my very similar issue.
I am running Windows 8 x64 bit and installed a modded version of Eclipse in a custom path (rather the default install location that was suggested) - and I got that error.
So, I deleted that Eclipse install. Then installed both x86 and x64 versions of JDK (to their default install locations), and repeated the Eclipse install to the default install location - that solved the problem for me!!!
The reason I installed both JDK versions was because I initially installed only the x64 bit version and a different error came. So I removed that Eclipse again, and repeated the JDK with both versions, etc...
I was on this problem for like an hour and a half not getting that if you save the eclipse file in a non-English named folder it doesn't open.
Hope it helps :)
Check if there are 2 Java paths mentioned in the system Variable "Path"
If yes, Move up the Java path which is mentioned in JAVA_HOME.
For example:
If JAVA_HOME=C:\Program Files\Java\jdk1.8.0_211
then the Path should have same Java version's path
Path=C:\Program Files\Java\jdk1.8.0_211
In my case I just changed the Path from
Path=C:\Program Files\Java\jdk1.6.0_45\bin
To
Path=C:\Program Files\Java\jdk1.8.0_211
Remove Eclipse from Non English folder if any.
This is issue might be because of the folder location or the JDK version,
I installed the latest version JDK and with eclipse-inst-win64 provided by eclipse i was able to install and run successfully
Same thing happens when you change eclipse.exe to a different name, seems like org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar starts the ide and looks for eclipse.exe
In my case, the Eclipse installer downloaded the wrong VM vertion. I download it separately. Choose it in clause "Java 11+ VM" and it works. Also check you do not have Russian letters in eclipse.ini. If you do, then change the encoding to UTF-8 and write the right letters in Russian.

Error in setting JAVA_HOME

I have recently downloaded Maven and followed the instructions given on this this page. I already have ant installed on my machine.
Now, if I want to verify that Maven is installed perfectly or not it is giving me error that JAVA_HOME is not set correctly, but same works perfectly fine for ANT.
For Maven I tried :
1. open cmd
2. type mvn -version
3. Error appeared :
C:\Users\Admin>mvn -version
ERROR: JAVA_HOME is set to an invalid directory.
JAVA_HOME = "C:\Program Files\Java\jre7\bin"
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation
For ANT I tried and worked :
1. open cmd
2. type mvn -version
3. Apache Ant(TM) version 1.9.1 compiled on May 15 2013
I went to the directory to check that java.exe is actually there in that directory or not and it was there. I checked the environment variables they set fine. I restarted the system and checked again but same problem. Please let me know what am I missing.
JAVA_HOME should point to jdk directory and not to jre directory. Also JAVA_HOME should point to the home jdk directory and not to jdk/bin directory.
Assuming that you have JDK installed in your program files directory then you need to set the JAVA_HOME like this:
JAVA_HOME="C:\Program Files\Java\jdkxxx"
xxx is the jdk version
Follow this link to learn more about setting JAVA_HOME:
http://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html
Do not include bin in your JAVA_HOME env variable
Follow the instruction in here.
JAVA_HOMEshould be like this
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_07
JAVA_HOME = C:\Program Files\Java\jdk(JDK version number)
Example: C:\Program Files\Java\jdk-10
And then restart you command prompt it works.
Just remember to add quotes into the path if you have a space in your path to java home.
C:\Program Files\java\javaxxx\ doesn't work
but
"C:\Program Files\java\javaxxx\" does.
The JAVA_HOME should point to the JDK home rather than the JRE home if you are going to be compiling stuff, likewise - I would try and install the JDK in a directory that doesn't include a space. Even if this is not your problem now, it can cause problems in the future!
You are pointing your JAVA_HOME to the JRE which is the Java Runtime Environment. The runtime environment doesn't have a java compiler in its bin folder.
You should download the JDK which is the Java Development Kit. Once you've installed that, you can see in your bin folder that there's a file called javac.exe. That's your compiler.
JAVA_HOME should point to jdk directory like in the image with new variable, like below
PATH should point to jdk bin like below
Run the below command in your terminal and restart it.
> set JAVA_HOME="C:\Program Files\Java\jdk-xx.xx"
xx.xx is the java version

JAVA_HOME does not point to the JDK

I am trying to follow a tutorial about how to use ant to build and run your application. I've followed all the steps and have created the build file, but when I try to run ant it gives me this error.
BUILD FAILED
/home/bilal/tmp/ant/build.xml:19: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-openjdk/jre"
Any ideas how to resolve this issue ?
Make JAVA_HOME variable point to a jdk installation, not jre.
You are referencing the runtime environment, not the development kit - it can't find the compiler because its not there.
From the line you posted, which states you have open-jdk you can just remove the jre at end:
export JAVA_HOME='/usr/lib/jvm/java-6-openjdk/'
You installed java...
apt-get install default-jre
But not the JDK...
apt-get install default-jdk
This is by design. You cannot use ant's java.home (which is a java.lang.System property) interchangeably with how JAVA_HOME is set in the OS environment. You are probably trying to assert the location of the Java compiler with a fundamentally different value from a different property layer -- i.e. java.home (from Ant's Java internals) points to the Java Runtime Environment at <any_installed_java_pointed_to_by_ant>/jre while JDK_HOME (from the OS environment) is usually set to <DOWNLOADED_AND_INSTALLED_JAVA_DEVELOPMENT_KIT>.
See my question and answer here for more details: Where does Ant set its 'java.home' (and is it wrong) and is it supposed to append '/jre'?
The solution is to access the system environment property within Ant by using ${env.JAVA_HOME}. Specify which java to use explicitly in the Javac Task by setting the executable property to the javac path and the fork property to yes (see Ant's Javac Task Documentation). That way, it doesn't matter what Java environment Ant is running inside, the compiler is always clearly specified!
I know this question is old but the accepted answer does not work anymore and since this is the fist link on google search i'll tell how i solved this problem.
for eclipse using ubuntu:
go to Window->Preferences->Ant->Runtime->Select Ant_Home_Entries and click on add external jars then find in file explorer where your jdk is (default is in /usr/lib/jvm/) and in the lib folder of your jdk you will find the tool.jar. select this one and click apply.
try to build your project and things should work!
note: i hadn't used ant for a long time but needed it for ycsb couchbase workload generator (http://www.couchbase.com/wiki/display/couchbase/Load+Generator+Setup) if anyone is/was stuck on this.
It looks like you are currently pointing JAVA_HOME to /usr/lib/jvm/java-6-openjdk/jre which appears to be a JRE not a JDK. Try setting JAVA_HOME to /usr/lib/jvm/java-6-openjdk.
The JRE does not contain the Java compiler, only the JDK (Java Developer Kit) contains it.
I am using Windows 7 and have struggled with the same issue. I fixed it by changing my environment variables.
To change your environment variables click here
I added ";%JAVA_HOME%/bin" to the end of paths variable and added a new "JAVA_HOME" variable and set its value to the location of my JDK "C:\Program Files\Java\jdk1.8.0_11". After that I restarted my Node.js command prompt and it worked.
Please note you JDK directory may be different then mine. Also depending on your setup, you may need to restart you computer after setting the environment variables.
The JAVA_HOME you have above only points to the JRE, which does not contain the compiler. Set your JAVA_HOME to
/usr/lib/jvm/java-6-openjdk
...and try again.
I had a similar problem and it turned out the issue was having both versions 6 & 7 of OpenJDK. The answer comes from r-senior on ubuntu forums (http://ubuntuforums.org/showthread.php?t=1977619) --- just uninstall version 6:
sudo apt-get remove openjdk-6-*
make sure that JAVA_HOME and CLASSPATH aren't set to anything since that isn't actually the problem.
for centos yum -y install java-1.7.0-openjdk-devel.x86_64
and update JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86-64
I just copied tools.jar file from JDK\lib folder to JRE\lib folder. Since then it worked like a champ.
Experienced this issue when trying to run the android emulator with Meteor 1.0 on elementary OS Luna (based on Ubuntu 12.04 LTS sources).
openjdk-6-jdk was installed, as well as the jre. In the end, not expecting any success, I tried:
sudo apt-get remove openjdk-6-*
this resulted in fully expected errors, so I followed up with
sudo apt-get install openjdk-6-jdk
and things worked. Go figure.
On Ubuntu 14.04, I found two parts to solving the problem:
Remove /jre from the environment variable. For me: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
Install the JDK as well as the JRE: sudo apt-get install default-jdk
Once you update the JAVA_HOME path as stated in the answer, you should do this:
$source ~/.bashrc
This will refresh bashrc show the updated path in $JAVA_HOME when you check again.
Execute:
$ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-3.b16.el6_9.x86_64
and set operating system environment:
vi /etc/environment
Then follow these steps:
Press i
Paste
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-3.b16.el6_9.x86_64
Press esc
Press :wq
I met this issue in rhel, my "JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk"(which is a symbolic link), and ant complains.
MY solution for this is to use the real jdk path in JAVA_HOME, like:
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64
It works for me.
Under Jenkins it complains like :
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/ doesn’t look like a JDK directory
Reason : Unable to found any Dev Kit for JDK.
Solution:
Please make sure to install openjdk-devel package as well along with your JDK-1.8* version and reexport with : # source ~/.bash_profile

Java -version gives a warning

When I type "java -version" from command prompt, I get the following warning :
Error loading: C:\Program Files\Java\jre6\bin\msvcr71.dll
My JDK is in the following directory :
C:\Program Files (x86)\Java
And I have also given the path to bin as :
C:\Program Files (x86)\Java\jdk1.8.0\bin
Then, what is the problem?
Well, first off, you've installed a jdk or jre version 1.6 and then added the 1.8 (which I'm guessing is a ver early non final version). That's why your JDK 1.8 executable is looking for libraries in your JRE6 install. Try uninstalling all JDKs/JREs and reinstall only the one you want to use. And if that doesn't work, try installing one of the stable releases like 1.7 from here
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Try using the x64 version. Based on your paths you are using x86 version of java jdk. Your path is looking for the msvcr71.dll on your x64 location.
Another thing to check, look into your environment variables and check if there are other instances of the java path there. You should have JAVA_HOME as a variable and include it into your path like so:
%JAVA_HOME%\bin

Ant and Eclipse

Hi I am a beginner java programmer and recently I've started reading Thinking in Java 4th edition to consolidate my knoledge of java after I read Head first Java.Problem is that this book has it's own library and I can't seem to make it work in eclipse even after I did everything it said on the website guide.I instaled ant acordinly with this video guide http://www.youtube.com/watch?v=XJmndRfb1TU and i'm getting this error:
"Unable to locate tools.jar.Expected to find it in C:\Program files\Java\jre7\lib\tools.jar
Buildfile:C:\TIJ4\code\build.xml
build:
BUILD FAILED
C:\TIJ4\code\build.xml:59:J2SE5 required
Total time:0 seconds
I tried reinstaling JDK witch was suggested on a forum but it still dident work so I don't really know what to do.
Can anyone tell me how can I solve this problem? Also, more importantly, can't this be done with Eclipse alone without installing Ant(I've only used eclipse for code writing and compiling so I'm not very familiar with it)Thant you.
You are using a JRE instead of a JDK. Install a JDK and point your PATH and JAVA_HOME variables to the JDK home, not to the JRE home.
I see that Ant is using the Java Home from the JRE, e.g. C:\Program files\Java\jre7\
But it should be C:\Program files\Java\jdk1.7.0\ or similar.
Check your system's environment variables (e.g. press Windows-Key and Pause together, then select Extended Settings > Environment Variables. Check that JAVA_HOME is set to the JDK installation path and that in the PATH variables, the folder of the JDK comes before the folder of the JRE (or remove/replace the JRE path altogether with the one from the JDK).
Ant needs to find the JDK first in the PATH.
Install the JDK, latest version, and check the environment variable JAVA_HOME.
If it is not found, create it and set it to C:\Program Files\Java\jdk1.7.0 ...
tools.jar contains the java compiler, and only comes with the Java Development Kit (JDK). Your error message point to the Java Runtime (JRE).
From Eclipse, you set that from Window/Preferences/Java/Installed JREs. This is equivalent to, and will override, the alternative way of setting it via Windows environment variables.
I tried installing the JDK - jdk1.7.0_09
and did whatever was needful in the Environment Variables section
but i still was getting this error
"Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre7\li
b\tools.jar
Buildfile: build.xml does not exist!
Build failed"
Tools.jar file did not really exists in this path, instead i found it in C:\Program Files\Java\jdk1.7.0_09\lib
so i simply copied this tools.jar file and placed it under C:\Program Files\Java\jre7\li
b\
and it worked - (not sure if that was the right way)
Now when i typed in the cmd prompt "ant" it gave me the below error :
Buildfile: build.xml does not exist!
Build failed
On investigating it further i found that if you get the above error it means that ant is installed successfully
http://ant.apache.org/manual/install.html#getBinary - Check Installation
what ivantrox86 said is true, but you need to do it in all the build.xml files, and there are like 20 of them. so go to each and every folder in the c:\tij4\code directory and find every build.xml file, and change the second argument (arg2) to 1.5, instead of the default value (${ant.java.version}). works 100%
This can happen with ant if JAVA_HOME is set incorrectly - it seems to try to guess what the value should be and comes up with the jre7 address. In my case setting JAVA_HOME to C:\Progra~1\Java\jdk1.7.0_45 fixed the problem. Of course the address will vary depending on where your jdk is installed.
please search and change this line in all files.:
<equals arg1="1.5" arg2="${ant.java.version}"/>
for
<equals arg1="1.5" arg2="1.5"/>

Categories