Java Beginners Questions

Discussion in 'Mac Programming' started by Coffee-Drinker, Sep 10, 2009.

  1. Coffee-Drinker macrumors newbie

    Coffee-Drinker

    Joined:
    Sep 10, 2009
    #1
    Hello, everyone,
    I want to start programming in Java. I am running Snow Leopard on an Imac. So far, I got the book "Java Head First" and started to read. Still, coming from Linux/Windows, many things are confusing.
    1. Is the Java SDK already installed in Snow Leopard or do I have to install it manually?
    2. Where can I get the Java API documentation? I can only find one for Java 1.5 on the Apple Developer Page, not for 1.6.
    3. I uninstalled XCode completely. Did I remove stuff, I need for Java development?
    4. I wanted to download Eclipse. But only the classic 64bit Cocoa version seems to work due to Snow Leopard Java 1.6 being 64bit. How can I extend the classic 64bit eclipse version to the Java EE version? Is there a simple way? What plugins do I have to download?
    5. Is there any other source for the Java environment except Apple itself (like in Windows you download from Sun directly)? Or is OS X itself not the best idea for Java programming?
    Thank you very much for your answers.

    Coffee-Drinker
     
  2. sanPietro98 macrumors 6502a

    sanPietro98

    Joined:
    May 30, 2008
    Location:
    28.416834,-81.581214
    #2
    OS X is a great environment for Java. Just expect a delay between new releases of Java and that release being supported on OS X.

    If you want to know whether you still have java on your system (and what version it is), do the following:
    - Open Terminal
    - type: java -version

    Here is the link to the Java 1.6 API:
    http://java.sun.com/javase/6/docs/api/index.html?overview-summary.html
     
  3. sanPietro98 macrumors 6502a

    sanPietro98

    Joined:
    May 30, 2008
    Location:
    28.416834,-81.581214
    #3
    I (personally) would just use the Java that is supplied by Apple. It is stable and has been reworked so that its Look and Feel match Cocoa (for the most part).
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    1. Yes, the JDK is already pre-installed. You can use all the normal Java command-line tools in Terminal.app. Enter the command-line: apropos java

    2. Use the online docs from Sun. They're the same across platforms, by definition. If you want a local copy to avoid being online while reading docs, you can download that from Sun, too.

    There should eventually be a Developer Documentation package for Java on Snow Leopard, but I don't see it yet. When it's available, it should be announced on Apple's Java-Dev list.

    http://lists.apple.com/mailman/listinfo/java-dev

    3. Only if you think Xcode is necessary for Java development. If you develop Java/native JNI code, then you might find Xcode useful. Not necessary, but useful. I think the C compiler is present regardless of Xcode, but I haven't checked on Snow Leopard. If you're just starting, though, then JNI isn't in your immediate future, so don't worry about it.

    4. Snow Leopard Java has both a 64-bit and a 32-bit option. You should be able to use 32-bit Eclipse. However, there may be problems on SL, although I can't recall any specific ones. You should google Apple's Java-Dev list with keywords:

    site:lists.apple.com java snow leopard eclipse

    Also check the Eclipse site's forums or bug-reports for known problems with Snow Leopard. Really, if I tell you here or you read about it on Java-Dev, you're getting it second-hand. Better to go to the home page of the actual product and get it straight from the horse's mouth.

    Regarding Java EE: if you're just starting to learn Java, you won't need EE right away. By the time you need it, you should be skilled enough in Eclipse and other tools that you can figure it out then. Don't get too far ahead of where you need to have your attention.

    5. It depends on what "Java environment" means to you. If you mean the fundamental classes and tools (the JRE, Java Runtime Environment), then there is a separate port called Soy Latte (google keywords java soy latte). If you mean an IDE, then there are several that run on Macs: JBuilder, NetBeans, Eclipse, BlueJ, etc. If you specifically mean a Java EE development environment, you'll have to spend some quality time with google, because EE development and deployment is a field with a lot of different parts and players.
     
  5. Coffee-Drinker thread starter macrumors newbie

    Coffee-Drinker

    Joined:
    Sep 10, 2009
  6. sanPietro98 macrumors 6502a

    sanPietro98

    Joined:
    May 30, 2008
    Location:
    28.416834,-81.581214
    #6
    Also, to do Enterprise Java, you don't need the J2EE version of eclipse. You can always put the appropriate JAR files in your classpath based on which J2EE vendor you're working with.

    I agree with chown33, if you're new to Java and just want to learn, it's better to stick with Java Standard Edition for now.
     

Share This Page