compiling java 1.5 w/ xcode 3??

Discussion in 'Mac Programming' started by lilili, Feb 29, 2008.

  1. lilili macrumors newbie

    Feb 29, 2008
    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?

  2. Mernak macrumors 6502

    Apr 9, 2006
    Kirkland, WA
    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"
    			   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.
  3. lilili thread starter macrumors newbie

    Feb 29, 2008
    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?
  4. giancarloromeo macrumors newbie

    Feb 5, 2008
    Look at this ;)

Share This Page