Posted by
admin on Dec 13, 2011 in
Web Design |
8 comments
I’m beginning a new Java tutorial using Eclipse as my IDE. Every time I have used Eclipse in the past there have been installation problems so, I’ll try to fix that issue here.
I use Eclipse because in my opinion it is the best free IDE available.
Also note that I’ll provide Java 1.7 installation steps for PCs, but Java 1.6 & 1.7 steps for MACs. The reason why I’m doing that is because Java 1.7 isn’t quite ready yet for Eclipse on MACs.
Don’t worry, there isn’t that much of a difference between Java 1.6 and 1.7. At least for a beginner tutorial.
Checking Your Version of Java
Java 1.6 has been around since December 2006, so chances are you already have it installed on your computer. To find out type the following in either your Terminal (MACs), or Command Line (PCs) java -version
When you do you’ll probably see the following:
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
Install Java 1.7 MACs
If you don’t have Java 1.6 installed for Mac go here to get it. You can get a preview release of Java 1.7 for Mac here.
Here are the instructions on how to install it from Oracle:
- Manually create a JavaVirtualMachines directory under /Library/Java if it does not exist already:
$> sudo mkdir /Library/Java/JavaVirtualMachines
- Download the Oracle JDK7 Mac OS X Port DMG file
- Open the DMG file by double clicking on it
- Drag the JDK 1.7.0 Developer Preview icon to the JavaVirtualMachine icon
Install Eclipse Java 1.6 & 1.7 for Macs
Now that you have Java setup on your Mac, it is time to set up Eclipse. Go
here to download the Eclipse IDE for Java Developers.
After you install Eclipse you have to set it up to work with Java.
- Execute Eclipse and then click on Elipse and Preferences in the top menu
- Expand the list item named Java and click Installed JREs
- Click the Add… button
- Java 1.6 should be set as the default
- If not select Standard VM in the JRE Popup Window
- Type /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home into JRE home
- Type Java1.6 as the name
- Click Finish
Do the same for Java 1.7, except leave 1.6 as the default and also instead enter Java1.7 for the name and the following for the JRE home /Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home
You’re done and ready to use Java 1.6 & 1.7 in Eclipse
Install Java 1.7 PCs
For PCs go
here to download Java 1.7 unless you already have it installed. Make sure you download the JDK and not the JDE. Find the Java executable you just downloaded and double click it. Follow the prompts to install it.
The Java files will be located at C:\Program Files\Java\jdk1.7.0 after installation.
Install Eclipse Java 1.7 for PCs
To get Eclipse to work on PCs is nearly identical to the MAC installation. Go
here to download the Eclipse IDE for Java Developers.
After you install Eclipse you have to set it up to work with Java.
- Execute Eclipse and then click on Windows and Preferences in the top menu
- Expand the list item named Java and click the Compiler option (Don’t Expand it)
- Check if Compiler Compliance Level is set to 1.7
- If it isn’t change it to 1.7 in the dropdown
- Click on Installed JREs and if you see jre6 as checked you’re done
- If jre6 isn’t checked click the Add… button
- Select Standard VM in the JRE Popup Window
- Under Directory select the home directory for JRE 1.7 (See Above)
- Click Finish
Eclipse Code Completion for Java 1.7
To set up code completion for Java 1.7 in Eclipse just open your preferences folder, click on Compiler, and set Compiler Compliance Level to 1.7. This currently isn’t working for MACs, but should work soon. If you have a PC this will work. See image below to better understand the change.
That’s All Folks
I hope this tutorial helps you to easily install Eclipse, so you can use it to learn java. Leave any questions below.
Till Next Time
Leave a Reply
That’s perfect to me. it coudn’t be better because i was wondering witch application language i have to learn to make somme counting applications. i found that java was the perfect language and quiet frankly i was going to ask you witch to help me choise betwen android and java or purpose to me another language to made some pc applications.
i am a lucky gay derek to know you.
sometimes it is enough that I think of something for you to give me the answer. i am in.
thank you very mutch derk
Java is pretty much the language of choice for developing applications for any OS. I’m not sure what I’m going to do. I basically want to try and cover the basics in an understandable way.
I’m lucky to know you too
thanks, bro would u please help us to know about visual basic programming?
Sorry, I don’t have a PC. Mine broke
I’ll look into whether I can get ahold of a compiler for Mac?
is it possible to make a chat application with php ?
Absolutely I actually pretty much made one with my PHP forum tutorial. Actually Facebook was made using PHP
I don’t know which version of Eclipse to download. There are many. Which one are you using?
Actually most will work because Eclipse works with Java out of the box. Either Eclipse IDE for Java Developers, or Eclipse Classic works though. Of course pick the one that works with your operating system here Eclipse Download