compiling java 1.5 w/ xcode 3??

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

  1. macrumors newbie

    Joined:
    Feb 29, 2008
    #1
    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
     
  2. macrumors 6502

    Joined:
    Apr 9, 2006
    Location:
    Boston, MA
    #2
    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
    Code:
    	<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.
     
  3. thread starter macrumors newbie

    Joined:
    Feb 29, 2008
    #3
    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. macrumors newbie

    Joined:
    Feb 5, 2008
    #4
    Look at this http://giancarloromeo.netsons.org ;)
     

Share This Page