learning java

Discussion in 'Web Design and Development (archive)' started by Low, Nov 1, 2003.

  1. Low macrumors member

    Nov 1, 2003
    hi guys, i wanna learn java. i know some vb and maybe a tad bit c++ if i can remember hard enough, lol. i learned all on PC platform though, and i just recently made the switch. i just upgraded to panther and was wondering if there was a built in complier or something for java in here. can anyone point me in the right direction to start some beginner development in java? i wanna work off my powerbook so what do i need?
  2. Taft macrumors 65816


    Jan 31, 2002
    Re: learning java

    Panther comes with a third disc containing the Apple developer tools (now all under the "XCode" umbrella). The java compiler comes with these tools. Just install XCode and you'll install everything you need to develop in Java.

    Once you've installed XCode, open up your Terminal application (located in Applications->Utilities). Type 'javac' on the command line. You should see the usage statement for the java compiler. This should let you know if the java development tools are correctly installed.

    After that, you can dig right in. Use javac to compile your .java source code files and java to run your programs from the compiled .class files. Alternately, you can use the XCode IDE to create, compile and run Java projects. In the end, either method should yield the same results (except if you want to create "native" Java programs for Mac OS X, in which case you are forced to use XCode).

    For a tutorial on Java development, go here: http://developer.java.sun.com/developer/onlineTraining/ There are tutorials on just about every aspect of the Java language. Also sun.java.com has some more vital information on Java, including full Java API documentation.

    FYI, the version of Java that comes with Panther is 1.4.1.

  3. debo macrumors regular

    Jan 9, 2004
    Sorry, I know this post is old, but How can I just open a java file in xcode, and then compile it? (without using javac)
  4. King Cobra macrumors 603

    Mar 2, 2002
    Taft, it's actually the fourth disk in the Panther box. The first three relate directly to the workings [sic] of the OS.

    Technically, you're supposed to create a project first, then a target, then add target files, THEN hit the build and run option, which I never figured out successfully. But don't bother trying to go through all that nonsense anyways (unless you would die to find out how to fix a variable in an app while its running and have the changes reproduced).

    When I asked this question to people in the IRC chat room, and to others on AIM, about why the Build & Run option wasn't in my Xcode window (thinking that Xcode would be such a simple app to use), I either got a laugh in the face ("lol" or "LOL" etc.), a response that said: "Xcode sucks," and/or a recommendation for another product.

    So out of the three responses that I received in turn (see above paragraph), I'm going to return the favor with two recommendations. Download JGrasp and (unless your computer is less than a 400MHz G3) IBM Eclipse.

    JGrasp - Small, simple, and fairly fast application.

    Eclipse (version 3.0M8) - A very "heavy" application in comparison, but tells you, as you're coding, the instant you type up something wrong in your code. This program has a learning curve of at least an hour, so become familiar with it before you get into the meat using it. Also, you can create stand-alone apps using Eclipse...this is nice for me because JarBuilder (the OS X dev. disk utility that does the same) crashes almost every time I try to add a custom icon. This program requires project creations and adds files automatically to your project folder when you put them in.

    You can work back and forth between the applications, as well.
  5. debo macrumors regular

    Jan 9, 2004
    Yeah, I use Jgrasp, I just thought like you, that Xcode could do the same type stuff easily.
  6. bousozoku Moderator emeritus

    Jun 25, 2002
    Gone but not forgotten.
    Xcode is good if you want to start a Java application, especially if it's just for Mac OS X--so much for pure Java.

    jGrasp is my favourite with Eclipse and Sun's NetBeans not far behind it. NetBeans will create GUI elements visually, so it's quite useful.

Share This Page