[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 [2014/01/18 12:20 (UTC)] – Explain about the profile script in the Java package alienbobhowtos:software:java [2014/11/08 12:39 (UTC)] (current) – [Java not found after installation] fix typo in name of profile.d bormant
Line 77: Line 77:
 Help! I installed Java but when I try to use it, I get "command not found"! 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).+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> Here follows the content of such a script on 64-bit Slackware: <code>
Line 84: Line 84:
 export MANPATH="${MANPATH}:${JAVA_HOME}/man" export MANPATH="${MANPATH}:${JAVA_HOME}/man"
 export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin" export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
-</code> This means that right after installing the Java package, you either need to logout and login again. 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>+</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 . /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. </code> Note the dot character at the start of the line, that dot is the "source" command of the shell.
 howtos:software:java ()