Ubuntu Linux: Install Eclipse Java Integrated Development Environment
Q. How do I install Eclipse integrated development environment and write first program under Ubuntu Linux Eclipse IDE?
A. Eclipse is free and open source integrated development environment (IDE) software. You need to install Java JDK and JRE before installing Eclipse.
Install Sun JDK and JRE
Open terminal and type the following commands to install Sun Java JDK and JRE:
$ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
$ sudo vi /etc/jvm
Add following line at the top:
/usr/lib/jvm/java-6-sun
Set up environment:
$ echo 'export JAVA_HOME=/usr/lib/jvm/java-6-sun' >> ~/.bash_profile
$ echo 'export PATH=$PATH:$JAVA_HOME/bin' >> ~/.bash_profile
$ . ~/.bash_profile
Make sure you see correct JAVA version:
$ java -version
Sample output:
java version "1.6.0_06" Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)
Install Eclipse
Type the following command to install extensible Tool Platform, Java IDE, Java Development Tools plug-ins for Eclipse:
$ sudo apt-get install eclipse eclipse-jdt
How do I start eclipse?
Click on Applications > Programming > Eclipse
OR type the following command at shell prompt:
$ eclipse &
You should see an eclipse splash screen followed by workspace launcher:
Your first java program using Eclipse
Click Ok to load IDE. Close welcome screen. Click on Windows > Open perspective > Select Java .
Step # 1: Create a project
You need to create a project to put all .java and related project files. Click on File > New > Project > Select Java Project
Click Next > Type Project name "HelloWorld" > Click on Finish:
Step # 3: Create a new class
Now you need add a new class called HelloWorld. Click on File > New > Class > Set class name to "HelloWorld" > Select the checkbox to create the main() method > click Finish button:
Step # 3: Type the code
Type the following code inside main() method:
System.out.println("Hello world!\n");
Press CTRL + S to save program (or visit File > Save option).
Step # 4: Run your first java application
To run your program Select HelloWorld.java from left panel. Click on Run > Run As > Java Application :
The Console view should appear at the bottom of the IDE to display the "Hello, world!" output.
- Ubuntu Linux: Install Eclipse Java Integrated Development Environment
Capture each and every moment of life with a FREE 4 GB SD memory card with the purchase of select digital cameras from Canon, Nikon, Pentax and others from Amazon
E-mail
Print
Can't find an answer to your question? Contact us
Related Other Helpful FAQs:
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: eclipse hello world java program, Eclipse IDE, integrated development environment, java development tools, java project, java version, jre, open perspective, sun java jdk, sun jdk









October 10th, 2008 at 5:34 pm
I’ve always use the following to change default java versions:
[code]
update-java-alternatives –list
sudo update-java-alternatives –set
[/code]
source: http://bit.ly/3Oa2uF