PDA

View Full Version : compiling java 1.5 w/ xcode 3??




lilili
Mar 1, 2008, 12:28 AM
Hi everyone
I am trying to compile my java code in xcode but it keep saying
generics are not supported in 1.3.

while trying to compile the same code using javac in terminal works fine.
I'm wondering how can I change the java compiler xcode use?

Thanks



Mernak
Mar 1, 2008, 11:34 AM
Interesting, I never knew that it want to use 1.3 now, it used to be okay with 1.5. Anyways there should be a "build.xml" file in the project and it should have a segment like this <target name="compile" depends="init" description="Compile code">
<mkdir dir="${bin}"/>
<javac deprecation="on" srcdir="${src}" destdir="${bin}"
source="1.3" target="1.2"
includeAntRuntime="no"
classpathref="lib.path" debug="${compile.debug}"> changing the source and target to 1.5 should fix that. I had the same problem in another java IDE (Java Studio Creator 2).

Please note that I have not actually done this myself to make sure it works, but I am pretty sure that it will.

lilili
Mar 1, 2008, 02:53 PM
Mernak, you the man.
That's the remedy i've been looking for.

Now, do I always have to edit build.xml for every java5 project or I can make it default to 1.5 somehow?

giancarloromeo
Apr 20, 2008, 06:52 AM
Now, do I always have to edit build.xml for every java5 project or I can make it default to 1.5 somehow?
Look at this http://giancarloromeo.netsons.org ;)