JAva templates in xcode 3.2

Discussion in 'Mac Programming' started by frustrated007, Oct 23, 2009.

  1. frustrated007 macrumors newbie

    Oct 23, 2009
    I am confused. From what I've read here and elsewhere, most of the project templates that were in xcode 2 are not in xcode 3. Still, you can use the Organizer to create some java applications, but you don't get an xcode project file -or do you get one and I just didn't find how?

    The story is, I just got a new MacBookPro (yeah!:)) and I am importing all my stuff from my old MacBookPro. In particular I have a console Java application created in XCode 2; the project opens fine in Xcode 3 but it won't build. So I put my code in the Organizer generated java app and it works fine, but I would still like to get it the old way with the project file...
  2. Watabou macrumors 68040


    Feb 10, 2008
    United States
    My problem is similar. Do you get "build xml can't be found" error?
  3. SRossi macrumors regular

    May 27, 2009
    Glasgow, Scotland
    Don't know if this will be help but found this

  4. frustrated007 thread starter macrumors newbie

    Oct 23, 2009
    Thanks Stephen, that sort of confirms what I found.
    All the java stuff is gone in xcode 3.2 and that's odd as in the help of this same Xcode 3.2, Apple boasts how java is really totally integrated in the System...

    No I get something that starts with "Internal error occurred while creating dependency graph"
  5. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Depending on which Xcode 2 project template you originally used, the old way may not be possible.

    Xcode 3.2 completely removed the 'jam' build system. Jam was the builtin Xcode build system since the beginning of time. Xcode 2 introduced a "native target" build system, but that can't build Java targets.

    Xcode 2 also introduced Java project templates that used the Ant build system. So if your original Xcode 2 project was jam-based, then Xcode 3.2 can't build it at all. There should be an error message that mentions jam in the build results window. It may also give the bogus recommendation to convert it to a native target.

    However, if the original Xcode 2 project was Ant-based, then Xcode 3.2 should be able to build it as-is. Ant requires a "build.xml" file, which it uses to tell it what and how to build. If that file is missing or deleted for some reason, then Ant can't build. If that happens, Ant should emit the "build.xml can't be found" error message.

    If the Organizer project can't be built because build.xml is missing, then you'll have to restore build.xml. The simplest way I know to do that is to create a new Organizer Project from an appropriate template, then move your existing src folder over to the new project (use Finder). Don't delete build.xml in the new project.

    Java beginners may find it easier to start writing code by ignoring Xcode 3.2 and using an IDE designed for beginners: BlueJ.

    There are other Java dev tools available. BlueJ is just one that others I've suggested it to found useful for getting started. Some people dislike it because it's not a pro-level IDE. Those people might be better served by a professional tool, rather than one oriented toward education.
  6. frustrated007 thread starter macrumors newbie

    Oct 23, 2009
    XCode 2.4.
    Yes my Xcode 2 project has a build.xml file and actually is built using Ant in XCode 2. I saw the project configuration has a "custom build" instruction that specifies a particular path to Ant; this path happens to be not right in the Xcode 3.2 -or perhaps it is a difference in the system (I have XCode 2 installed on 10.4). So actually I deleted this "Custom build" thing and got the error mentioned above. I'm guessing that to get it the old way I just need to figure out what Custom Build instruction should be specified but after looking around a bit I didn't find an answer.

    That's what I did, it works just fine.
    Thanks for mentioning BlueJ, I'll have a look at it.
  7. frustrated007 thread starter macrumors newbie

    Oct 23, 2009
    I figured it out. I specified /usr/bin/ant as the Build Tool and it works.

Share This Page