3

I have ubuntu 12.04 LTS version 64 bit . what is the procedure for installing and running Java for development purpose. I am new to Linux and Unix platform. Thanks in advance

VRU
  • 1,147

4 Answers4

2

On the command line, type:

$ sudo apt-get install openjdk-7-jre

OR

1) Goto http://www.java.com/en/download/linux_manual.jsp 2) Download the 64-bit package.

Installation:

Change to the directory in which you want to install. Type:

cd <directory path name>

For example, to install the software in the /usr/java/ directory, Type:

cd /usr/java/

Note about root access: To install Java in a system-wide location such as /usr/local, you must login as the root user to gain the necessary permissions. If you do not have root access, install Java in your home directory or a subdirectory for which you have write permissions. Move the .tar.gz archive binary to the current directory.

Unpack the tarball and install Java:

tar zxvf jre-7u7-linux-x64.tar.gz

The Java files are installed in a directory called jre1.7.0_07 in the current directory. In this example, it is installed in the /usr/java/jre1.7.0_07 directory. When the installation has completed, you will see the word Done. Delete the .tar.gz file if you want to save disk space.

Ron
  • 20,638
owl
  • 4,951
  • 1
    thanks and how do I specify the path and class-path ? – grv.giit Dec 31 '12 at 06:40
  • 1
    http://docs.oracle.com/javase/tutorial/essential/environment/paths.html will help. Scroll down to "Linux" section. – owl Dec 31 '12 at 06:43
  • IMO, you are better off with the Oracle JDK rather than OpenJDK as when I used OpenJDK, I could not launch for example AndroidStudio as it checks if your using it and warns you not to. Minecraft game also recommends not to use it as it isn't supported. Most things will work fine with it but some apps check for it and block you even trying. – brim4brim May 27 '13 at 00:02
  • " When the installation has completed, you will see the word Done. " - umm, what? No. There is no "installation" done, only unpacking. Java isn't installed after this.. – phil294 Mar 07 '16 at 14:47
0

If you are connected to internet then just click on the "Ubuntu Software Center" and type Java in the search box, you will find Java IDE's in result. choose one that you were looking and select Install.

VRU
  • 1,147
0

For me it's much easier to install it from software center, just go to development category java already there, Click to read more information i recommend you, if you need special kind of java, because ubuntu offers an Open JDK

-1

If you have internet connected then just do-

sudo apt-get install default-jdk

That will do the work for you...

Ravan
  • 9,379
pranav
  • 7
  • 6
  • yes ,it works everytime..the latest stable java release is installed..you dont have to worry about version number..its better...@UserName22 – pranav Oct 30 '15 at 07:59
  • This doesn't install the 64-bit version which was the issue the OP had. – Mike Bethany Jun 15 '16 at 09:00