PDA

View Full Version : Beginner's Java Development & Compiler




Mac Rules
Mar 24, 2009, 05:57 AM
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?

Cheers
:apple:



lee1210
Mar 24, 2009, 08:33 AM
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.

-Lee

Howiieque
Mar 24, 2009, 10:49 AM
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.

plinden
Mar 24, 2009, 10:58 AM
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.

Mac Rules
Mar 25, 2009, 09:28 AM
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

eddietr
Mar 25, 2009, 10:04 AM
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

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.

Mac Rules
Mar 25, 2009, 10:16 AM
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.

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.

Thanks

wrldwzrd89
Mar 25, 2009, 10:31 AM
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.

eddietr
Mar 25, 2009, 10:40 AM
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.

Thanks

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

ChrisA
Mar 25, 2009, 10:47 AM
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?

Cheers
:apple:

Get the JDK from sun at "sun.com" 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 http://java.sun.com/javase/downloads/index.jsp

This link is good also http://java.sun.com/new2java/

Cromulent
Mar 25, 2009, 11:32 AM
Get the JDK from sun at "sun.com" 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 http://java.sun.com/javase/downloads/index.jsp

This link is good also http://java.sun.com/new2java/

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.

iShater
Mar 25, 2009, 11:41 AM
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.

wrldwzrd89
Mar 25, 2009, 02:33 PM
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.
Totally agree with this advice - that's exactly how I learned Java, and what I continue to do to this day. :D

rev316
Mar 25, 2009, 09:43 PM
Eclipse.

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.