[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:software:java [2013/02/19 18:38 (UTC)] – Stress the fact that you have to download everything in the java directory. alienbobhowtos:software:java [2014/11/08 12:39 (UTC)] (current) – [Java not found after installation] fix typo in name of profile.d bormant
Line 1: Line 1:
-<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> 
 ====== Java in Slackware ====== ====== Java in Slackware ======
  
Line 15: Line 14:
 <note important>Please do NOT install both packages and make sure you remove any previously installed Java packages before you start the installation</note> <note important>Please do NOT install both packages and make sure you remove any previously installed Java packages before you start the installation</note>
  
-===== Java (JDK) Installation on Slackware 14 =====+==== Java (JDK) Installation on Slackware 14 and newer ====
  
 Follow the steps below to install Java on your system: Follow the steps below to install Java on your system:
Line 62: Line 61:
  
 10. If you want [[slackware:slackpkg|slackpkg]] to ignore the jre and jdk packages on clean-system, add them to the blacklist in ''/etc/slackpkg/blacklist'' 10. If you want [[slackware:slackpkg|slackpkg]] to ignore the jre and jdk packages on clean-system, add them to the blacklist in ''/etc/slackpkg/blacklist''
 +
 +
 +===== OpenJDK =====
 +
 +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/|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 [[http://slackware.com/~alien/slackbuilds/icedtea-web|icedtea-web]] package. Oracle kept its browser plugin closed-source. The //icedtea-web// package is an open-source alternative.\\ You will also need [[http://slackware.com/~alien/slackbuilds/rhino|rhino]], the JavaScript engine for OpenJDK.
 +
 +If you decide you want to compile OpenJDK from source, then use the [[http://slackware.com/~alien/slackbuilds/openjdk/build/README.txt|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: <code>
 +#!/bin/sh
 +export JAVA_HOME=/usr/lib64/java
 +export MANPATH="${MANPATH}:${JAVA_HOME}/man"
 +export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
 +</code> 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 "//[[wp>Dot_(Unix)|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): <code>
 +. /etc/profile.d/openjdk.sh
 +</code> Note the dot character at the start of the line, that dot is the "source" command of the shell.
 +
  
 ====== Sources ====== ====== Sources ======
   * Original source: [[http://slackware.org.uk/slackware/slackware64-current/extra/java/README|java.SlackBuild readme]]   * Original source: [[http://slackware.org.uk/slackware/slackware64-current/extra/java/README|java.SlackBuild readme]]
   * Contributions by [[wiki:user:sycamorex|sycamorex]]   * Contributions by [[wiki:user:sycamorex|sycamorex]]
- +  Contributions by [[wiki:user:alienbob|Eric Hameleers]]
- +
-<!-- Contrbutions by [[wiki:user:yyy User Y]] -->+
  
 <!-- Please do not modify anything below, except adding new tags.--> <!-- Please do not modify anything below, except adding new tags.-->
-<!-- You must also remove the tag-word "template" below. Otherwise your page will not show up in the Table of Contents --> 
 {{tag>howtos software java jdk jre author_sycamorex}} {{tag>howtos software java jdk jre author_sycamorex}}
 howtos:software:java ()