Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 26, 2005, 04:03 AM   #1
iEdd
macrumors 68000
 
iEdd's Avatar
 
Join Date: Aug 2005
Location: Australia
Send a message via AIM to iEdd
Java Programming: Beginning

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
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?
iEdd is offline   0 Reply With Quote
Old Dec 26, 2005, 07:10 AM   #2
devman
macrumors 65816
 
devman's Avatar
 
Join Date: Apr 2004
Location: 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.
devman is offline   0 Reply With Quote
Old Dec 26, 2005, 09:13 AM   #3
Mitthrawnuruodo
Moderator
 
Mitthrawnuruodo's Avatar
 
Join Date: Mar 2004
Location: 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.
__________________
Those who fail to learn history are doomed to repeat it; those who fail to learn history correctly... why, they are simply doomed.
Mitthrawnuruodo is offline   0 Reply With Quote
Old Dec 27, 2005, 01:50 AM   #4
iEdd
Thread Starter
macrumors 68000
 
iEdd's Avatar
 
Join Date: Aug 2005
Location: Australia
Send a message via AIM to iEdd
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*

Last edited by iEdd; Dec 27, 2005 at 02:02 AM.
iEdd is offline   0 Reply With Quote
Old Dec 27, 2005, 05:27 AM   #5
Mitthrawnuruodo
Moderator
 
Mitthrawnuruodo's Avatar
 
Join Date: Mar 2004
Location: 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:
Attached Thumbnails
Click image for larger version

Name:	Picture 9.jpg
Views:	27
Size:	35.5 KB
ID:	37531  
__________________
Those who fail to learn history are doomed to repeat it; those who fail to learn history correctly... why, they are simply doomed.

Last edited by Mitthrawnuruodo; Dec 27, 2005 at 06:09 AM.
Mitthrawnuruodo is offline   0 Reply With Quote
Old Dec 27, 2005, 06:32 AM   #6
mdavey
macrumors 6502a
 
Join Date: Nov 2005
Quote:
Originally Posted by epepper9
•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!

Quote:
•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)
mdavey is offline   0 Reply With Quote
Old Dec 27, 2005, 11:09 AM   #7
bobber205
macrumors 68020
 
bobber205's Avatar
 
Join Date: Nov 2005
Location: Oregon
Send a message via AIM to bobber205 Send a message via Yahoo to bobber205 Send a message via Skype™ to bobber205
I would have to highly recommend "Thinking In Java".

It's a great book, and it's REALLY cheap on ebay.
bobber205 is offline   0 Reply With Quote
Old Dec 27, 2005, 12:22 PM   #8
mwpeters8182
macrumors 6502
 
Join Date: Apr 2003
Location: Boston, MA
Thinking in Java can also be had for free in HTML format.

http://www.mindview.net/Books/TIJ/
__________________
2.0 GHz Aluminum MacBook
iPhone 3G
mwpeters8182 is offline   0 Reply With Quote
Old Dec 27, 2005, 01:20 PM   #9
bobber205
macrumors 68020
 
bobber205's Avatar
 
Join Date: Nov 2005
Location: Oregon
Send a message via AIM to bobber205 Send a message via Yahoo to bobber205 Send a message via Skype™ to bobber205
But I've always liked a hard copy of really useful information.
bobber205 is offline   0 Reply With Quote
Old Dec 28, 2005, 03:29 PM   #10
mwpeters8182
macrumors 6502
 
Join Date: Apr 2003
Location: Boston, MA
oh, definitely, a hard copy is better. But it's a good way to take the book out for a test run.

MP
__________________
2.0 GHz Aluminum MacBook
iPhone 3G
mwpeters8182 is offline   0 Reply With Quote
Old Dec 28, 2005, 03:32 PM   #11
ChrisBrightwell
macrumors 68020
 
ChrisBrightwell's Avatar
 
Join Date: Apr 2004
Location: Huntsville, AL
I learned Java from the command line, then upgraded to JBuilder (at work) and Eclipse (at home/school).
__________________
"Simplicity is the ultimate sophistication."
ChrisBrightwell is offline   0 Reply With Quote
Old Dec 28, 2005, 04:02 PM   #12
jeremy.king
macrumors 603
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
Quote:
Originally Posted by ChrisBrightwell
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.
jeremy.king is offline   0 Reply With Quote
Old Dec 28, 2005, 07:19 PM   #13
iEdd
Thread Starter
macrumors 68000
 
iEdd's Avatar
 
Join Date: Aug 2005
Location: Australia
Send a message via AIM to iEdd
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.
iEdd is offline   0 Reply With Quote
Old Dec 28, 2005, 07:47 PM   #14
jeremy.king
macrumors 603
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
Quote:
Originally Posted by epepper9
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.
jeremy.king is offline   0 Reply With Quote
Old Dec 28, 2005, 07:54 PM   #15
devman
macrumors 65816
 
devman's Avatar
 
Join Date: Apr 2004
Location: AU
Quote:
Originally Posted by epepper9
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.

devman is offline   0 Reply With Quote
Old Dec 29, 2005, 04:18 AM   #16
ChrisBrightwell
macrumors 68020
 
ChrisBrightwell's Avatar
 
Join Date: Apr 2004
Location: Huntsville, AL
Quote:
Originally Posted by epepper9
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.
__________________
"Simplicity is the ultimate sophistication."
ChrisBrightwell is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Java 6.x security risk (?) vs Java 7.x and broken apps w/ v7.x installs? mgiamo Mac Basics and Help 1 Dec 15, 2013 04:48 PM
Java programming presi iPad Apps 2 Jun 19, 2013 05:12 PM
Chrome on OS X -- Java plugin / Java 7 vs Java 6 Issue booyahbooyah Mac Applications and Mac App Store 4 May 31, 2013 10:13 AM
C++ and / or Java programming mark28 iPad Apps 1 Jul 23, 2012 01:37 AM
Beginning OpenGL 3.0+ Programming (again) in OS X, targeting multiple platforms Soulstorm Mac Programming 6 Jul 10, 2012 10:34 AM

Forum Jump

All times are GMT -5. The time now is 12:01 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC