Java Programming

Joined
Sep 19, 2007
Messages
7
Reaction score
0
Points
1
I'm in a beginning java programming class and I would like to be able to program on my mac.

on a pc i make it in notepad, save it as something.java and then use the command prompt to compile and run it.

On a mac i have no idea how to do it or if it is as easy. if anyone has experiance with doing this i'd be interested.
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
Hey scrum! I'm in a similar course this semester!

You can basically do exactly what you do on the PC:

Open Textedit, go to the 'Format' menu and select make plain text, type your program, save it as 'program.java'.

Then open the "terminal" (In applications> utilities) and type: "cd the location of your file". (hint, or type "cd " then drag in the file to have the terminal automatically fill in the path).

Then type "javac program.java" to compile and "java program.java" to run it.


That's the basics. If you want a nicer way of doing things, I can highly recommend Textmate. It has built-in systax highlighting, intelligently format your code and has special shortcuts for "compile & run" "complile and run in terminal" and the like.

There are also a bunch of other text editors (Subethaedit is also nice) that have syntax highlighting...

textmate-java-20071122-225425.jpg
 
Joined
Oct 31, 2007
Messages
69
Reaction score
0
Points
6
Your Mac's Specs
Mac Pro Quad Core 2.66, ATI 1900, 5 GB RAM, 750 GB Storage
Aptana is a free application for java editing and programming available from Apples site. You need Firefox for debugging but it seems to be very nice from the limited amount i have used it.
 
Joined
Jan 4, 2006
Messages
1,385
Reaction score
146
Points
63
Location
Hamburg, Germany
Your Mac's Specs
MacBook Pro | iMac(2.1 G5) | MacBook(2.16 C2D) | MacMini (1.67 CD) | iPhone 4 | iPad (3rd Gen)
If you are looking for a GUI try Eclipse.

I use Vim editor on Terminal for writing java programs. It is preinstalled in every Mac. To activate syntax highlighting, create a file called .vimrc on your users folder ~/ and type syntax on on it. Then save it and restart the Terminal. When you open a jave program next time, you should see all the color effects.
 

Del


Joined
Dec 24, 2006
Messages
901
Reaction score
15
Points
18
Location
N. Ireland
Your Mac's Specs
Mac Pro 2xQuad core 2.8GHZ
Eclipse gets my vote.
 
Joined
Mar 14, 2005
Messages
443
Reaction score
3
Points
18
Location
Atlanta, GA
Your Mac's Specs
17" Macbook Pro Unibody 2.66 Ghz and Powerbook G4 1.67 GHz 2.0GB RAM
Textmate owns. Not free though... Eclipse is nice if you want a real IDE.
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
I find eclipse horribly slow... it's probably necessary when you start developing apps with multiple classes, but for simple stuff less is more :)
 
Joined
Mar 22, 2007
Messages
1,463
Reaction score
67
Points
48
Location
UK
Your Mac's Specs
Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
Netbeans is nice, and looks more like an Apple app. Eclipse is a bit slow.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top