Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Debian(Sarge)]: java -version.

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
User avatar
cheikhbouchihda
Posts: 50
Joined: 2006-03-13 15:51
Location: Amiens, France.

[Debian(Sarge)]: java -version.

#1 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. :)

Jeroen
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 483
Joined: 2004-04-06 18:19
Location: Utrecht, NL
Contact:

#2 Post by Jeroen »

You'd best use java-package to install Java, it'll then be automatically configured. Adding things to your path shouldn't be needed.

As to why it doesn't work for you, did you login again? Do you actually really use bash or a compatible shell that reads /etc/profile?

User avatar
cheikhbouchihda
Posts: 50
Joined: 2006-03-13 15:51
Location: Amiens, France.

#3 Post by cheikhbouchihda »

It works: all had been installed by apt.....

#apt-cache search -n java #to get all the packages java

and then install them by apt-get(from the DVD of installation)

Anaway, it works ....
Thanks.
Mohammed from France.

Post Reply