Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Mac Rules

macrumors 6502a
Original poster
Jul 15, 2006
633
666
Europe
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

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
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

macrumors regular
Feb 1, 2009
120
0
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

macrumors 601
Apr 8, 2004
4,029
142
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

macrumors 6502a
Original poster
Jul 15, 2006
633
666
Europe
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

macrumors 6502a
Oct 29, 2006
807
0
Virginia
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

macrumors 6502a
Original poster
Jul 15, 2006
633
666
Europe
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

macrumors G5
Jun 6, 2003
12,110
77
Solon, OH
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

macrumors 6502a
Oct 29, 2006
807
0
Virginia
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

macrumors G5
Jan 5, 2006
12,922
2,181
Redondo Beach, California
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

macrumors 604
Oct 2, 2006
6,817
1,102
The Land of Hope and Glory
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

macrumors 604
Aug 13, 2002
7,027
470
Chicagoland
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

macrumors G5
Jun 6, 2003
12,110
77
Solon, OH
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

macrumors regular
Nov 7, 2004
156
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.