Using Xcode to code for JAVA

Discussion in 'Mac Programming' started by frnak, Sep 18, 2011.

  1. frnak macrumors member


    Oct 21, 2007
    Hi there, I'm a 2nd year computer science university student who's starting to learn OOP by starting with java programming.

    First of all, I am aware of of Eclipse, Netbeans, and IntelliJ for coding specifically for Java. However, Since I've become quite familiar with Xcode for C programming. I was wondering if it's possible to do strictly java coding/compiling/testing in Xcode 4.1 (newest version on Lion)

    If so, can anyone tell me how to set Xcode up for java programming...say..for a simple Hello World program.

    Much appreciated
  2. jsmwoolf macrumors regular

    Aug 17, 2011
    Technically, Apple has dropped support for Java with Xcode, so you can't create JAVA files with Xcode. I have tried to find a way to create JAVA files in Xcode, but it appears you just can't. However, Xcode can still open Java documents, but cannot run them. Eclipse is your best bet, but any other is fine too.
  3. foidulus macrumors 6502a

    Jan 15, 2007
    Seconded, there never really was any good reason to use Xcode for Java. Xcode's interface is great for Objective-C programs, but for anything else it doesn't really work all that well in my opinion. Download Eclipse, not only is it better suited towards Java development, there is a lot more documentation online for it as well.
  4. szymczyk macrumors regular

    Mar 5, 2006
    I agree with the other posters that are better IDEs than Xcode for Java development. However, if you really want to use Xcode 4 for Java development, create an external build system project. For a Hello World program, you could get away with using the Java compiler as the build tool. For larger programs use something like ant as the build tool.
  5. elppa macrumors 68040


    Nov 26, 2003
    Give both Eclipse and Netbeans a try first before you make up your mind.

Share This Page