oio11: (Default)
[personal profile] oio11
Instalar Java en GNU/Linux




Copyright

Copyright © José Luis Lara Carrascal  2007-2012
 



Резюме

Introduction
Java Runtime Environment (JRE)
Add Java Runtime Environment (JRE) to your PATH
Java Development Kit (JDK)
Add Java Development Kit (JDK) to your PATH
Apache Ant
Add Apache Ant to your PATH

Install Java plugin in web browsers
Scripting Java application execution
Complementary to install another version of Java
links


Java Runtime Environment (JRE)

This is the version that is used to run Java applications on your system, and is what most users installed that are not intended to compile any program.

1) jre-7u4-linux-i586.rpm

This version is intended for GNU / Linux distributions compatible with the packaging system of RedHat, RPM. (Fedora, Mandriva, openSUSE, PCLinuxOS, etc.).

Выполнение.


We go to the download area  http://www.oracle.com/technetwork/java/javase/downloads, we are at the same site as the image below and click on the red button Download, which is below JRE.

Then click on Accept License Agreement, and thereafter jre-7u4-linux-i586.rpm

Uninstall the previous version

In the case we have a version in rpm format, prior to JRE installed on your system, to avoid duplication desinstalaremos versions.
$ su
# rpm -e jre-1.7.0_03-fcs
# rm -rf /usr/java/jre1.7.0_03
# rmdir --ignore-fail-on-non-empty /usr/java &> /dev/null

Installing as root

$ su
# rpm -ivh jre-7u4-linux-i586.rpm

The package is fully installed in / usr/java/jre1.7.0_04, automatically creating the symbolic links / usr / java / default and / usr / java / latest.
Preparando...               ########################################### [100%]
   1:jre                    ########################################### [100%]
Unpacking JAR files...
        rt.jar...
        jsse.jar...
        charsets.jar...
        localedata.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...

2) jre-7u4-linux-i586.tar.gz

This version is intended for GNU/Linux distributions that are not compatible with the packaging system of RedHat, RPM. (Debian and derivatives, Slackware and derivatives, etc.).. You can also install distributions that support the old package, but has a drawback, the installation must be done manually.

Выполнение.

We go to the download area http://www.oracle.com/technetwork/java/javase/downloads, and follow the same procedure as the RPM version, where we will click on jre-7u4-linux-i586.tar . gz.


Uninstall the previous version

In the case we have an older version of JRE installed on your system by following the manual installation method used in this paragraph, delete it to avoid duplication of versions.


$ su
# rm -rf /usr/java/{jre1.7.0_03,default}
# rmdir --ignore-fail-on-non-empty /usr/java &> /dev/null

Installing as root

The installation must be done manually, we have to create as root, the
/usr/java, and extract the package in it, then creating a symlink default, which is what we use to set the PATH environment variable Java. Installation of desktop files, icons and mime is optional but highly recommended.

$ su
# mkdir -p /usr/java
# tar zxvf jre-7u4-linux-i586.tar.gz -C /usr/java
# cd /usr/java
# ln -s jre1.7.0_04 default
# cp -rf default/lib/desktop/* /usr/share
# update-mime-database /usr/share/mime
# for i in HighContrast HighContrastInverse LowContrast hicolor ; do \
gtk-update-icon-cache -t /usr/share/icons/$i ; \
done

Personal configuration directory

~/.javaEs el directorio de configuración personal y de la caché de Java en nuestro home.



Add Java Runtime Environment (JRE) to your PATH

We need to edit your configuration file Bash, ~/.bashrc for java applications to detect the existence of the environment we have installed, in addition, as with any directory /bin establishing new in our system, include it in our PATH to facilitate the implementation of its binaries. We will use the symbolic link / usr / java / default to not have to be editing this file every time actualizemos the Java environment.

Edit the file from our home, ~ /. Bashrc, if we see there and add the following to the end.


export PATH=/usr/java/default/bin:$PATH
export JAVA_HOME=/usr/java/default
To verify that the java binary is included in the path, open a terminal window and run the following command:

[jose@localhost ~]$ java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) Server VM (build 23.0-b21, mixed mode)

If we want to set an environment variable system-wide, open a text editor and add the following:
#!/bin/sh

export PATH=/usr/java/default/bin:$PATH
export JAVA_HOME=/usr/java/default

We keep the name java.sh, and installed it in / etc / profile.d.

$ su
# install -m755 java.sh /etc/profile.d

We have to close the terminal emulator and reopen for the environment variable is applied effectively. You should save a copy of this script for future installation of our system. The advantage of using the / etc / profile.d, it is common to all distributions and saves you having to edit other system files such as / etc / profile.


Java Development Kit (JDK)
It's the Java development environment in its standard format (there are other packages with added download page of Oracle Web), used to compile programs written in Java, or serve as a requirement for other programs written in other programming languages as a unit with Java support. If you install JDK not need to install JRE, since the latter is included in the development version.....http://manualinux.heliohost.org/java.html

October 2025

S M T W T F S
   1234
567891011
12131415161718
19202122 232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 3rd, 2026 04:18 pm
Powered by Dreamwidth Studios