20210628 - Upgrade of php fixed the page rendering issue.

Welcome to the Slackware Documentation Project

¡Esta es una revisión vieja del documento!

Por traducir - Victor

Java en Slackware

Oracle Java

Debido a los cambios recientes en las licencias Java de Oracle, Slackware o cualquier otra distribución ya no puede distribuir paquetes binarios Java con el sistema operativo. Lo que significa para nosotros es que, aunque todavía podremos instalar Java en nuestro sistema, a partir de Slackware 14 se nos solicitará que descarguemos manualmente el paquete binario.

Oracle ofrece dos paquetes:

  • JRE (Java Runtime Environment): requerido para ejecutar aplicaciones Java.
  • JDK (Kit de desarrollo de Java): necesario para desarrollar y ejecutar aplicaciones Java (incluye el JRE).

Como el JRE está incluido en el JDK, el Kit de desarrollo de Java (JDK) es un paquete recomendado para instalar.

NO instale ambos paquetes y asegúrese de eliminar los paquetes Java previamente instalados antes de comenzar la instalación

Java (JDK) Installation on Slackware 14 and newer

Follow the steps below to install Java on your system:

1. Visit the official download page.

2. Right under Java Platform, Standard Edition click the JDK Download and accept the license agreement.

3. Download a binary package that is appropriate for your architecture:

Linux x86 for a 32-bit version of Slackware.
Linux x64 for a 64-bit version of Slackware.

Make sure you have chosen the .tar.gz version.

At the time of writing this, the latest version (64-bit) was:


4. In a terminal log in as root:

su -

5. Go to the /extra/source/java directory on a Slackware installation DVD or change to the local directory if you downloaded it from a Slackware mirror (in which case, don't forget to download all the files and subdirectories in that “java“directory!).

6. Run the java SlackBuild specifying the path to the downloaded Java binary package.

./java.SlackBuild /path/to/jdk-7u7-linux-x64.tar.gz

Once the SlackBuild finishes, you should get a similar message:

Slackware package /tmp/jdk-7u7-x86_64-1.txz
If you get the following message, you can disregard it.
WARNING: zero length file usr/lib64/java/lib/security/trusted.libraries

7. Install the newly created package:

upgradepkg --install-new /tmp/jdk-7u7-x86_64-1.txz

8. Restart a web browser and try if Java has been detected by visiting the following website.

9. You may need to reboot the computer for the system to recognize Java:

$ which java

10. If you want slackpkg to ignore the jre and jdk packages on clean-system, add them to the blacklist in /etc/slackpkg/blacklist


If you prefer the fully Open Source alternative of OpenJDK instead of Oracle's pre-compiled and partly closed-source binaries, then you can get sources, SlackBuild scripts and/or native Slackware packages here: http://slackware.com/~alien/slackbuilds/openjdk/.

If you decide you want to use OpenJDK, the same rules apply that were written above for the Oracle Java packages: only install one of the two, either JRE or JDK! If you want a web-browser plugin like Oracle's binaries have, then install the additional icedtea-web package. Oracle kept its browser plugin closed-source. The icedtea-web package is an open-source alternative.
You will also need rhino, the JavaScript engine for OpenJDK.

If you decide you want to compile OpenJDK from source, then use the README for guidance.

Java not found after installation

Help! I installed Java but when I try to use it, I get “command not found”!

What you need to know is that the Java package installs two files in your profile directory ”/etc/profile.d/”. Depending on which login shell you use, one of these is executed whenever you login. The profile script adds the Java directory to the $PATH variable (so that you can start the java command) and sets the $JAVA_HOME variable (needed by other programs that try to locate your Java installation).

Here follows the content of such a script on 64-bit Slackware:

export JAVA_HOME=/usr/lib64/java
export MANPATH="${MANPATH}:${JAVA_HOME}/man"
export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"

This means that right after installing the Java package, you need to logout and login again in order to load the Java profile script. If it is inconvenient to logout right now, there is an alternative: you can “source” the script by running the following command in your console, or in every terminal where you want to use Java without logging out and in again (example for OpenJDK and a bash-compatible shell):

. /etc/profile.d/openjdk.sh

Note the dot character at the start of the line, that dot is the “source” command of the shell.


En otros idiomas
Traducciones de esta página?:
QR Code
QR Code es:howtos:software:java (generated for current page)