[Debian(Sarge)]: java -version.

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
cheikhbouchihda
Forum Commoner
Posts: 51
Joined: Thu Mar 02, 2006 2:08 pm
Location: France.

[Debian(Sarge)]: java -version.

Post by cheikhbouchihda »

Hello,
I have installed the jdk1.6.0, without problem an d in order to add it in the PATH, I have changed the /etc/profile as follows:

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/chaouch/jdk1.6.0/bin"

if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\[\e[0;33m\u@\h:\w\\$\[\e[0m '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
PATH=$PATH:/home/chaouch/jdk1.6.0/bin
CLASSPATH=$CLASSPATH:/home/chaouch/jdk1.6.0/lib/tools.jar
CLASSPATH=$CLASSPATH:/home/chaouch/jdk1.6.0/jre/lib/rt.jar
JAVA_HOME=/home/chaouch/jdk1.6.0
JDK_HOME=/home/chaouch/jdk1.6.0
export PATH CLASSPATH JAVA_HOME JDK_HOME PS1

umask 022



Nevertheless, when I do:

Code: Select all

$java -version


java: command not found.

also, if I do:

Code: Select all

$echo $PATH

/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

but not:
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/chaouch/jdk1.6.0/bin

Where is the error please? and what must I do to have java in the PATH ?
Thanks in advance.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

You need to make sure that /etc/profile is "sourced/run" again.

source /etc/profile
Post Reply