Linux Tips : Setting Java programming environment in Ubuntu Linux

I do a lot of programming in Ubuntu Linux. A couple months ago I started to learn JAVA, previously I have used to program in C/C++ which fortunately Ubuntu is already built in GCC (GNU C Compiler) so everything works out of the box. Unfortunately the case is not the same as JAVA, Ubuntu is not shipped with Java JDK/JRE. So, you must install everything by yourself.

I found out one of my favourite IDE in Windows that support JAVA programming is also available on Linux, it is NetBeans. Netbeans is free Integrated Development Environment (IDE) that supports a lot of languages, including Java, JavaScript, PHP, Python, Ruby, C/C++ and more. NetBeans is written in Java and runs with Java Virtual Machine (JVM) installed. For Java development functionality you must install JDK first, but for other languages you can just install JVM.

Install JDK/JRE Ubuntu Linux

Okay, let’s start with installing JDK and JRE. There are two ways Installing JDK and JRE, the easy way is from Synaptic Package Manager and the hard way is install from .bin file. Installing from Synaptic Package Manager is the best way when you have internet connection or any access to repository (DVD, server, etc). But if your computer don’t have any access to repository server, you can download .bin file from Sun Website from other computer and install it on the computer that you want.

Option 1
First lets start with the easy way, install from Synaptic. Make sure you have the Multiverse repository enabled.

System > Administration > Software Source > Select Multisource > Close

Enable Multiverse Repository Ubuntu Linux

Open your terminal and type the following command to install JDK and JRE

$ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk

Wait till it download and install, depend on your connection it should take several minutes.
Make sure the correct version is used by using this command

$ sudo update-java-alternatives –s java-6-sun

Option 2

For those who want to install the hard way, first download JDK and JRE from Sun. You will get .bin file.

Download JDK bin file

Open your terminal, then go to directory where the download file is, and make sure the file is executable.

cd /directory/where/you/download/file
sudo chmod +x filename

Install the file with this command

sudo ./filename

Make sure the correct version is used by using this command

$ sudo update-java-alternatives –s java-6-sun

Install Netbeans Ubuntu Linux

Option 1
Download Netbeans from here and save it to your computer. Let’s say the file is called “netbeans-6.8-ml-linux.sh”. Run your terminal and change directory to where you download the file.

download netbeans

$ cd /direcory/where/you/download/file

Make sure the file is present by using ls command. Finally execute the following command

$ sudo ./netbeans-6.8-ml-linux

After completing command, you will see installer that will install NetBeans into /opt directory. Finish!.

Option 2
Alternatively you can also install using Synaptic Package Manager, just execute the following command.

$sudo apt-get install netbeans

Finish!.

Related entries:

  1. Linux Tips : Automatically find Fastest Repository Server in Ubuntu
  2. Linux Command Line Guide
  3. Real Time Proxy Server Monitoring
  4. What is a command prompt?
  5. Some Example Common DOS commands

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>