Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server which has centos installed in it. Recently I have installed jdk 1.6 into it.

When I try to run java command from shell it's working perfectly fine.

Java is stored into /usr/java/jdk1.6.0_25 and path is set to /usr/bin/ when I type which java.

When I tried running javaws (which comes with the jdk 1.6 only) it is showing me following error:

Java Web Start splash screen process exiting ...
Bad installation: JAVAWS_HOME not set: No such file or directory

Executing env command prints following details:

HOSTNAME=XX-XXX-XXX-XX
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
OLDPWD=/usr/java
SSH_TTY=/dev/pts/1
USER=root
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
JAVA_PATH=/usr/java/jre1.6.0_24/jre/bin
MAIL=/var/spool/mail/root
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jre1.6.0_24/jre/bin
INPUTRC=/etc/inputrc
PWD=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin
JAVA_HOME=/usr/java/jre1.6.0_24/jre/bin
LANG=en_US.UTF-8
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=1
HOME=/root
LOGNAME=root
JAVAWS_HOME=/usr/java/jre1.6.0_24/bin
SSH_CONNECTION=175.100.170.26 3387 64.150.190.94 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/bin/env
share|improve this question

closed as off-topic by kce, mdpc, Ward, Scott Pack, Nathan C Jul 22 '13 at 0:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about software development are off-topic here, but can be asked on Stack Overflow." – kce, mdpc, Ward, Scott Pack, Nathan C
If this question can be reworded to fit the rules in the help center, please edit the question.

Is that instance of java registered with alternatives? If so, you'd just need to do alternatives --config java, and pick the one you want. This will set your environment correctly.

share|improve this answer
    
Selection Command ----------------------------------------------- *+ 1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java 2 /usr/lib/jvm/jre-1.4.2-gcj/bin/java its showing me these values and if i choose any of this still give me the same error – Hunt Mar 18 '11 at 15:29
    
Maybe try installing jre 1.6 & choose that one instead of jdk? – churnd Mar 18 '11 at 15:30
    
Do i need to uninstall jdk before installing jre ? – Hunt Mar 18 '11 at 16:35
    
I have installed jre and set the PATH to bin dir of jre but getting the same problem :( – Hunt Mar 18 '11 at 18:26
    
what does env | grep JAVA say? – churnd Mar 18 '11 at 18:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.