[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/12/30 23:09 (UTC)] – [Java (JDK) Installation on Slackware 14] sycamorexhowtos:software:java [2014/11/08 12:39 (UTC)] (current) – [Java not found after installation] fix typo in name of profile.d bormant
Line 61: 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 ===== ===== OpenJDK =====
Line 70: Line 71:
  
 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. 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 ======
 howtos:software:java ()