Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » ANT - specify what version of java to use
ANT - specify what version of java to use [message #143121] Wed, 15 March 2006 11:26 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Darin Swanson is currently offline Darin SwansonFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:eclipse console no longer showing output
Next Topic:error: entry point not found
Goto Forum:
  


Current Time: Wed Jan 15 04:58:04 GMT 2025

Powered by FUDForum. Page generated in 0.06969 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top