ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikael Petterson (KI/EAB)" <mikael.petter...@ericsson.com>
Subject RE: How to set jdk version for ant
Date Wed, 24 Sep 2003 12:30:26 GMT
Hi,

I tried to add the following that you mentioned (Antoine).

So this is how my script looks like:

Script
-------
#!/bin/sh

JAVA_HOME=/app/jdk/1.4.2_01;export JAVA_HOME
echo ${JAVA_HOME}
PATH="$JAVA_HOME/bin:$PATH";export PATH
echo ${PATH}

# ant.jar is in the lib directory.
#java -version
java -cp ../lib/ant.jar org.apache.tools.ant.Main -debug -buildfile ../build/build.xml  all
execute
------------

However my compliation, javac, seems to fail (using -debug option).

Any more ideas? What am I doing wrong here?

//Mikael 

Ps.This is how it looks like under /app/jdk/1.4.2_01

bin/                         include/                     LICENSE                      README.html

COPYRIGHT                    jre/                         man/                         src.zip

demo/                        lib/                         README                       THIRDPARTYLICENSEREADME.txt


ant output ( -debug)
---------------------

BUILD FAILED
file:/home/eraonel/xml2j/bin/../build/build.xml:52: 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
        at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:139)
        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:835)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)


-----Original Message-----
From: Antoine Lévy-Lambert [mailto:antoine@antbuild.com]
Sent: den 24 september 2003 11:16
To: Ant Users List
Subject: AW: How to set jdk version for ant


maybe you have the problem because you have set your JAVA_HOME, but not your
path accordingly.

export JAVA_HOME="/app/jdk/1.4.2_01"
export PATH=$JAVA_HOME/bin:$PATH

Antoine

-----Urspr√ľngliche Nachricht-----
Von: Mikael Petterson (KI/EAB) [mailto:mikael.petterson@ericsson.com]
Gesendet: Mittwoch, 24. September 2003 09:58
An: user@ant.apache.org
Betreff: How to set jdk version for ant


Hi,

I have been trying to make sure that jdk1.4.2 is used for my ant 1.5.4 (
tasks java and javac). I am using a  script to execute my build.xml.
How can I make sure that jdk1.4.2 is used instead?

//Mikael

This is how the script looks like:

-------------------------------------------
#!/bin/sh

set JAVA_HOME="/app/jdk/1.4.2_01";export JAVA_HOME

#ant.jar is in the lib directory.
cd ../lib
java -cp ant.jar org.apache.tools.ant.Main -debug -buildfile
../build/build.xml all execute
--------------------------------------------

Then when I execute the build.xml I get the following ( using debug):

Apache Ant version 1.5.4 compiled on August 12 2003
Buildfile: ../build/build.xml
Detected Java version: 1.3 in: /afs/sunrise.company.se/EDUP/Jdk/1.3.1/jre
Detected OS: SunOS
Could not load class (org.apache.tools.ant.taskdefs.optional.PropertyFile)
for task propertyfile
Could not load class
(org.apache.tools.ant.taskdefs.optional.vss.MSVSSCHECKIN) for task
vsscheckin
 +User task: sql     org.apache.tools.ant.taskdefs.SQLExec

........

ompile:
     [echo] Compiling with 1.3!
fileset: Setup scanner in dir /home/eraonel/xml2j/src with patternSet{
includes:
 [] excludes: [] }

........

   [java] Executing '/afs/sunrise.company.se/EDUP/Jdk/1.3.1/jre/bin/java'
wit
h arguments:
     [java] '-classpath'




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message