Java Development Kit (Or simply JDK) is a software that provides us with exceptional development tools for programming and creating applications and Java programs peude same software installed on a local computer or a network drive
JDK is multi-platform and can be installed on Linux, Windows , Solaris and Mac OS. Today we will learn to Linux install, Specifically Debian and distributions based on it , such is the case Ubuntu. Recall that JDK is a necessary complement to IDE 's such as NetBeans, Which needed to program in Java.
1. First, we download the binary for Linux JDK. You can download it from here. Selecting the Linux platform and on the back page by clicking on the second download link (the first is architectural RPM). Once downloaded, save the file . bin in our personal folder (/ home / username).
2. Open a terminal and we login as root (using su ). Proceed to create the installation directory :
mkdir / usr / java
3. We assign permissions to your user owner (which is the JDK to be executed later) , with the command (note , change tu_usuario by your session on Debian or Ubuntu )
tu_usuario chown -R / usr / java
4. Copy the binary we downloaded earlier ( JDK 6 update 11) to the directory created (/ usr / java ) and we persmisos of performance:
cp / home/tu_usuario/jdk-6u11-linux-i586.bin / usr / java
chmod a + x / usr/java/jdk-6u11-linux-i586.bin
5. We launched the installation of the JDK binary :
./jdk-6u11-linux-i586.bin
6. Accept the license and proceed with the installation. Once completed, the owner must assign permissions to our user in the folder that is created during installation:
chown -R tu_usuario / usr/java/jdk1.6.0_11
7. To run the command "java and javac " from any location you need to edit the file . bashrc superuser ( root) and your user. To do this, we should edit the appropriate file for each user with the following lines, these will be added at the end:
export JAVA_HOME = / usr/java/jdk1.6.0_05
export PATH = $ JAVA_HOME / bin: $ PATH
To access edit the root user :
nano / root / .bashrc
For your username:
nano / home / tu_usuario / .bashrc
8. After adding the lines to both files, save and close the console. JDK is installed, with sufficient permissions and ready to program in Java.