DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Java
  4. How to Setup Your Java Development Environment in Ubuntu

How to Setup Your Java Development Environment in Ubuntu

Veera Sundar user avatar by
Veera Sundar
·
Nov. 15, 10 · Interview
Like (0)
Save
Tweet
Share
24.61K Views

Join the DZone community and get the full member experience.

Join For Free

In this post, I’m going to explain how you can setup a Java development environment (JDK + Eclipse) in Ubuntu. I’m using Ubuntu 10.10, but these steps should be applicable to majority of Ubuntu versions.

Let’s start with JDK first.

Install Sun JDK:

  1. Download the Linux version of latest JDK binary from the Oracle website. For Java 6, the file name would be: jdk-6u22-linux-i586.bin
  2. Copy the downloaded JDK file to a directory where you want to install the JDK. I use /home/<username>/java/jdk-6u22-linux-i586.bin
  3. Open terminal window and navigate to the directory where you copied the downloaded file. Then type the command: sudo sh jdk-6u22-linux-i586.bin and press enter.
  4. If it asks for root password, give it and JDK installation will begin. The JDK will be installed on the same directory where the binary is placed.

That’s it. JDK installation is done. But we still have one more step to complete. That is, setting up the JAVA_HOME environment variable.

Setting up JAVA_HOME environment variable:

  1. Go to Nautilus file browser (Places -> Home Folder) and open this file: “.bashrc”. By default this file is hidden. So, press Ctrl + H which will show all hidden files and then you can see the .bashrc file.
  2. Add the below code snippet at the end of the .bashrc file:
    export JAVA_HOME='/home/<username>/java/jdk1.6.0_22'
    PATH=.:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

    Don’t forget to change the path in first line according to where you installed your JDK

  3. That’s it. Log off and Log in again for the changes to take effect. To test whether the installation successful, open Terminal and type java -version which should show you the currently installed JDK version.

Install Eclipse:

Installing Eclipse in Ubuntu is pretty simple. Just download the ZIP file from Eclipse.org and then unzip it. The installation is done. ;-)

From http://veerasundar.com/blog/2010/11/how-to-setup-java-development-environment-in-ubuntu/

Java (programming language) ubuntu Java Development Kit

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Spring Boot, Quarkus, or Micronaut?
  • The Path From APIs to Containers
  • How To Handle Secrets in Docker
  • Fargate vs. Lambda: The Battle of the Future

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: