ANT - specify what version of java to use [message #143121] |
Wed, 15 March 2006 11:26 |
Eclipse User |
|
|
|
Originally posted by: chrisg.paper-river.com
I've got some java projects set up in Eclipse. These projects must be built
using Java 1.3, as they are running on a device that is limited to this JVM
version.
I have tried a numbe rof combinations of using different jdks and different
JAVA_HOME variables.
I can get Eclipse to build to 1.3 by setting the jdk to be used under the
workspace settings, however i cannot translate this to the ant build
scripts.
If i leave the eclipse jdk to 1.4, then the ant build works fine, but when i
try to run the created jar on the intended device, i get a
java.lang.NoClassDefFoundError: java/lang/StringBuilder error.
(TO my knowledge, i thought String Builder was implementeed in 1.5 not 1.4,
so i dont know how this is happening!)
So i tried switching the jdk in eclipse back to 1.3, and then running the
ant build - when doing this, the build doesnt happen, as it complains about
there not being a XML parser.
I tried having the eclipse jdk set to 1.4, and setting my JAVA_HOME variable
to the 1.3 jdk, but this creates the StringBuilder errors on the device as
before!
Can anyone explain to me how i might get this working?
Cheers
Chris
|
|
|
Re: ANT - specify what version of java to use [message #143202 is a reply to message #143121] |
Wed, 15 March 2006 16:57 |
Darin Swanson Messages: 2386 Registered: July 2009 |
Senior Member |
|
|
You will need to make use of the source and target attributes of the Ant
javac task.
See
http://ant.apache.org/manual/CoreTasks/javac.html
HTH
Darins
"Chris Gates" <chrisg@paper-river.com> wrote in message
news:dv8tom$qpi$1@utils.eclipse.org...
> I've got some java projects set up in Eclipse. These projects must be
built
> using Java 1.3, as they are running on a device that is limited to this
JVM
> version.
> I have tried a numbe rof combinations of using different jdks and
different
> JAVA_HOME variables.
>
> I can get Eclipse to build to 1.3 by setting the jdk to be used under the
> workspace settings, however i cannot translate this to the ant build
> scripts.
>
> If i leave the eclipse jdk to 1.4, then the ant build works fine, but when
i
> try to run the created jar on the intended device, i get a
> java.lang.NoClassDefFoundError: java/lang/StringBuilder error.
>
> (TO my knowledge, i thought String Builder was implementeed in 1.5 not
1.4,
> so i dont know how this is happening!)
>
> So i tried switching the jdk in eclipse back to 1.3, and then running the
> ant build - when doing this, the build doesnt happen, as it complains
about
> there not being a XML parser.
>
> I tried having the eclipse jdk set to 1.4, and setting my JAVA_HOME
variable
> to the 1.3 jdk, but this creates the StringBuilder errors on the device as
> before!
>
> Can anyone explain to me how i might get this working?
>
> Cheers
>
> Chris
>
>
>
|
|
|
Re: ANT - specify what version of java to use [message #143363 is a reply to message #143121] |
Thu, 16 March 2006 13:59 |
Eclipse User |
|
|
|
Originally posted by: olivier_thomann.NOca.ibm.comSPAM
Chris Gates a écrit :
> If i leave the eclipse jdk to 1.4, then the ant build works fine, but when i
> try to run the created jar on the intended device, i get a
> java.lang.NoClassDefFoundError: java/lang/StringBuilder error.
> (TO my knowledge, i thought String Builder was implementeed in 1.5 not 1.4,
> so i dont know how this is happening!)
Could you please give the build id?
How does your javac ant task look like?
Would you have a test case that reproduces the problem?
--
Olivier
|
|
|
Powered by
FUDForum. Page generated in 0.06969 seconds