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

iEdd

macrumors 68000
Original poster
Aug 8, 2005
1,956
4
Hey all, I got a book called Beginning programming with java for dummies by Barry Burd for Christmas. I read a bit through and I wanted to know what you guys recommend as an IDE or JDK (I think I have the terminology correct). I am currently using Netbeans, but I am aware that there are others like xcode, jbuilder, etc. I also have Java 2, build 5.0 version 3 I think it's called, the one up from version 1.4.2_09 or something. What an intelligent bunch that designed these version numbers :rolleyes:
So my questions are:
•What development software is best for a n00b like me?
•Does anyone else have this book?
•Any other good starting points you can recommend?
 

devman

macrumors 65816
Apr 19, 2004
1,242
8
AU
Eclipse is the dominant free IDE. It's where you'll want to end up if you're serious about Java, but it has it's own learning curve...

There's a free IDE supposedly for beginners called BlueJ. Gosling wrote positive things about it some time ago.

I'm no longer sure what the best Java book for beginners is. I've heard lots of good things about Head First Java - but I've not read that one myself. Once you lose your training wheels then Effective Java by Bloch is the bomb.

BTW, I'd add that if you are wanting to do Mac development then Objective-C and Cocoa is where you want to be. If you need cross platform, then Java rules.
 

Mitthrawnuruodo

Moderator emeritus
Mar 10, 2004
14,453
1,114
Bergen, Norway
For a complete newbie I would recommend just using your favorite text editor, something like TextWrangler or SubEthaEdit and then make small non GUI test programs that you compile and run with Terminal app. (javac/java). That's the best way to learn the basics.

Then when you need your first IDE, get BlueJ, it's made to be educational (wish that had been around when I started learning Java ;)).

Then, when you grow out of that, go for Eclipse. :)
 

iEdd

macrumors 68000
Original poster
Aug 8, 2005
1,956
4
Thanks for the comments and tips guys. I have been mucking around with ultra simple small programs in BlueJ, but I don't know how to run the .java file, all I get is the "There is no default application specified to run this document" dialog box in the finder.
Just making use of the
Code:
System.out.println
command with a few words. Excuse the lack of programming intelligence. *shrugs*
 

Mitthrawnuruodo

Moderator emeritus
Mar 10, 2004
14,453
1,114
Bergen, Norway
To start with the very beginning, the "hello world" app:

Use your favorite text editor and make a file named HelloWorld.java (mind the capital letters, HelloWorld is not the same as helloworld!), and enter this code:

Code:
class HelloWorld {
    public static void main(String[] args) {
        //Display "Hello World!"
        System.out.println("Hello World!");
    }
}

Open up Terminal.app, and navigate to where you saved the java file:

$ cd /path/to/file/

Then you must compile:

$ javac HelloWorld.java

And then you can run the application:

$ java HelloWorld

This will give you this output:

$ Hello World!

Then it's just a matter of adding more code into the main() method and start making your own functions and classes... ;)

If you've made a similar file in BlueJ, compiled that and then want to run it, you need to right/ctrl-click on the class in the project window and mark the method you want to run (in this case the main() method) as stated in the BlueJ tutorial:
 

Attachments

  • Picture 9.jpg
    Picture 9.jpg
    35.5 KB · Views: 79

mdavey

macrumors 6502a
Nov 1, 2005
506
1
epepper9 said:
•What development software is best for a n00b like me?

NetBeans is very good. If you are comfortable with it, I'd suggest sticking with it. If you start to find it lacking or it doesn't seem to fit your work style, try Eclipse. Personally I prefer NetBeans and you'll find that everyone has an opinion on which has the greater market share and which is better. Yes, Java has its own IDE religion war!

•Does anyone else have this book?
•Any other good starting points you can recommend?

* Get hold of the Java Certification Study Guide (get the latest version you can find)
* Go to java.sun.com and try the tutorials (there are masses there)
* Both java.net and onjava.com have excellent and regular articles on Java technologies
* Later (after you have been coding for six months or so), check out:
** "Effective Java" / Bloch; Addison Wesley Press
** Junit (a simple technology to build unit test cases)
** Apache Ant (a simple Java-based build tool)
 

bobber205

macrumors 68020
Nov 15, 2005
2,182
1
Oregon
I would have to highly recommend "Thinking In Java".

It's a great book, and it's REALLY cheap on ebay.:D
 

jeremy.king

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
ChrisBrightwell said:
I learned Java from the command line, then upgraded to JBuilder (at work) and Eclipse (at home/school).

This is usually what I try to recommend to beginners too. No reason to introduce an IDE when you are just learning the language, it only provides another point of confusion. FWIW, I start out with command line, Visual Cafe, Eclipse 2, WSAD, Eclipse 3, and most currently Rational Application Developer.
 

iEdd

macrumors 68000
Original poster
Aug 8, 2005
1,956
4
Thanks for all the further replies. I'm not sure how writing java in a command line makes things easier. I rarely have success with terminal, all these errors occur. BlueJ has made things easy for starting. Basicly just 4 steps:
•Start new class
•Type code
•Compile
•Run
It's all good. Once again, MR always brings good replies fast. Thanks heaps.
 

devman

macrumors 65816
Apr 19, 2004
1,242
8
AU
epepper9 said:
Thanks for all the further replies. I'm not sure how writing java in a command line makes things easier. I rarely have success with terminal, all these errors occur. BlueJ has made things easy for starting. Basicly just 4 steps:
•Start new class
•Type code
•Compile
•Run
It's all good. Once again, MR always brings good replies fast. Thanks heaps.

nicely done. Good for you.

:)
 

ChrisBrightwell

macrumors 68020
Apr 5, 2004
2,294
0
Huntsville, AL
epepper9 said:
I'm not sure how writing java in a command line makes things easier.
Do you want simplicity or do you want an understanding?

Writing and compiling from the command line gives you a more complete understanding of the process(es) involved in Java development. Using an IDE to do things like package management abstracts a lot of the critical pieces of the language that are best learned, at first, from the command line.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.