PDA

View Full Version : Java Programming: Beginning




iEdd
Dec 26, 2005, 03:03 AM
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
Dec 26, 2005, 06:10 AM
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
Dec 26, 2005, 08:13 AM
For a complete newbie I would recommend just using your favorite text editor, something like TextWrangler (http://www.barebones.com/products/textwrangler/) or SubEthaEdit (http://www.codingmonkeys.de/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 (http://www.apple.com/downloads/macosx/development_tools/bluej.html), 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
Dec 27, 2005, 12:50 AM
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 System.out.println command with a few words. Excuse the lack of programming intelligence. *shrugs*

Mitthrawnuruodo
Dec 27, 2005, 04:27 AM
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:

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 (http://www.bluej.org/tutorial/tutorial.pdf):

mdavey
Dec 27, 2005, 05:32 AM
•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
Dec 27, 2005, 10:09 AM
I would have to highly recommend "Thinking In Java".

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

mwpeters8182
Dec 27, 2005, 11:22 AM
Thinking in Java can also be had for free in HTML format.

http://www.mindview.net/Books/TIJ/

bobber205
Dec 27, 2005, 12:20 PM
But I've always liked a hard copy of really useful information.

mwpeters8182
Dec 28, 2005, 02:29 PM
oh, definitely, a hard copy is better. But it's a good way to take the book out for a test run.

MP

ChrisBrightwell
Dec 28, 2005, 02:32 PM
I learned Java from the command line, then upgraded to JBuilder (at work) and Eclipse (at home/school).

jeremy.king
Dec 28, 2005, 03:02 PM
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
Dec 28, 2005, 06:19 PM
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.

jeremy.king
Dec 28, 2005, 06:47 PM
I'm not sure how writing java in a command line makes things easier.

Because you will learn the ins and outs of the SDK and the JVM. ;)

devman
Dec 28, 2005, 06:54 PM
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
Dec 29, 2005, 03:18 AM
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.