Beginner's Java Development & Compiler

Discussion in 'Mac Programming' started by Mac Rules, Mar 24, 2009.

  1. macrumors 6502

    Mac Rules

    Hi guys,

    Well I'm looking to start my Computer Science studies fairly soon and thought it would be a good idea to get a head start by getting some practice with Java. I've got a recommended textbook to learn from, now I just need some software to write on. Can anyone suggest a good SDK and compiler etc that could be used on Mac and on PC?

  2. macrumors 68040


    Dependent on the sort of Mac you have and the OS on it, you'll either use the Java 5 SDK or the Java 6 SDK that is provided by apple. I don't know if this comes preinstalled or if you need to install it from your OS DVD, but you should be able to find out pretty quickly by seeing what the output of javac is at the terminal. Javac is the compiler included with the SDK (they call it a JDK, i think). Otherwise you'd just need an editor and the terminal, compiling your classes with javac and running with java.

    You can use XCode, Apple's IDE, for Java development. I haven't spent much time, but it seems to work fine the few times i've tried it. Eclipse is also available for OS X, which is one of the "preferred" IDEs for Java. Netbeans and others are available for OS X as well.

  3. macrumors regular

    I asked something similar the other day. And people encouraged me to just use javac and java in the terminal instead of IDE. Just for beginner.

    What textbook are you using?

    And I have almost finished the Head First Java--a very good book whose author also used Mac for teaching Java. The author also think a beginner should not use IDE.
  4. macrumors 68040


    For beginners and simple, single (or even just one or two) class programs, yes, it's a good idea to get used to using javac on the command line ... just to get an idea of what's happening underneath. Of course, it's not strictly necessary to know everything, but if you're serious about programming you'll be interested anyway, and you'll be a better programmer at the end.

    When you start getting into collaborating with others on complex programs, I'd recommend trying out Eclipse or Netbeans ... both free IDEs that work well on OS X. Which one you prefer is a matter of choice. I wouldn't use XCode.
  5. macrumors 6502

    Mac Rules

    Thanks for the replies guys, do any of these work with PC as I'll need to use the SDK on both Vista and OS X (and potentially Linux, but that's not important right now). I believe I'm right in assuming that javac is just a compiler, but is there any particular software I need to actually 'write' the programs?

    Thanks again
  6. macrumors 6502a

    javac is javac on any of those platforms. There is also gcj, but use of that is limited and I wouldn't recommend it for someone learning java. Especially since javac is freely and easily available.

    And ant is a very common build tool that is also easily available for windows, linux, and OS X.

    And a good editor of your choice + javac + ant + java (of course) is all you really *need* to write code.

    But if you prefer to use an IDE, then things like Eclipse (my choice) or Netbeans will run perfectly well on windows, linux and the Mac with the same interface on all 3.

    Hope that helps.
  7. macrumors 6502

    Mac Rules

    Thanks for that, I have stumbled across Netbeans on my Google hunts, do you think this would be a suitable environment to learn and progress well in? I'll have a look at Eclipse too.

  8. macrumors G4


    I use NetBeans myself. It's a wonderful IDE for development, and it's cross-platform too. However, if you're just learning you may find its features a bit confusing.
  9. macrumors 6502a

    Can't really comment on Netbeans since I've used it maybe once. I use Eclipse.
  10. macrumors G4

    Get the JDK from sun at "" and write some command line programs in the terminal. After a while you can go back to Sun and get NetBeans IDE.

    About NetBeans vs. Eclipse... Use the terminal at first. You don't need an IDE. The need to learn Java first all of the IDEs are are complex and of no help unless you know Java. Just use the terminal and write some simple programs.

    Netbeans comes from Sun and I think Eclipse came out of IBM. Both are big Java proponents. Either will work for you. But later. You don't want either of them now.

    There are others but if you are going to learn to use something it may as well be the "Standard issue" product straight off the Sun web site.

    Here is the link

    This link is good also
  11. macrumors 603


    Just a small correction you actually install the Java development kit for Mac OS X by installing Xcode. Sun do not release a version for Mac OS X themselves. The same is true of the runtime which you should make sure is fully up to date by running Software update.
  12. macrumors 604


    HF Java is a great book as you have noted. Make sure that when you go through it, you do ALL the exercises.

    Use the command line to compile and run to get used to it. Use TextEdit or TextWrangler as editors.

    When you are ready to get into IDEs, avoid XCode and go with Eclipse and NetBeans.

    Another good book is Learning Java from O'Reilly.

    They key is, practice practice practice. And don't use any WYSIWYG GUI (like NetBean's GUI editor), but code everything by hand.
  13. macrumors G4


    Totally agree with this advice - that's exactly how I learned Java, and what I continue to do to this day. :D
  14. macrumors regular


    Widely used de-facto standard for Java (well, most?) and it'll carry other languages as well. It's both an academic and professional powerhouse in software development.

Share This Page