cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to find JAVA after installation

Former Member
0 Kudos

Dear sir,

I would like to install ECC.6 on Red Hat Enterprises Linux 5.0 server for test purpose. I have already completed RHEL installation and perform all the recommendation written in SAP NOTES 171356, 1048303 etc.

I have installed JAVA as per the instructions given in the following links.

http://java.sun.com/j2se/1.4.2/install-linux.html

http://www.java.com/en/download/help/linux_install.xml

http://www.yolinux.com/TUTORIALS/LinuxTutorialJava.html#INSTALL_SDK

I am able to install JAVA on my Linux server but when I try to check whether the installation is successful or not I tried following commands, with the unexpected result.

#which java

/usr/bin/java

    1. Java -fullversion*

gives details of by default installed java.

Can anybody help me or guide me to install java correctly on my Linux server?

Any other details if you like I will provide.

Regards

Ahsan

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi

I have installed java on Linux by exactly performing your steps given, however when check the JAVA -Version it still says no java installed.

Detailed output.

-


[root@localhost /]# which java

/usr/bin/java

[root@localhost /]# java -version

java version "1.4.2"

gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)

Copyright (C) 2006 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost /]# ls -ltr

total 70406

-rw-rr 1 root root 35513469 May 10 2006 j2sdk-1_4_2_12-linux-i586.rpm

drwxr-xr-x 2 root root 4096 Oct 11 2006 srv

drwxr-xr-x 2 root root 4096 Oct 11 2006 opt

drwxr-xr-x 2 root root 4096 Oct 11 2006 mnt

drwxr-xr-x 2 root root 4096 Oct 11 2006 home

-rwxrwxrwx 1 root root 36337163 Sep 20 18:09 j2sdk-1_4_2_12-linux-i586.bin

drwx------ 2 root root 16384 Sep 24 22:18 lost+found

drwxr-xr-x 3 root root 4096 Sep 24 22:20 sapmnt

drwxr-xr-x 3 root root 4096 Sep 24 22:21 oracle

drwxr-xr-x 2 root root 4096 Sep 24 22:22 selinux

drwxr-xr-x 15 root root 4096 Sep 24 22:25 usr

drwxr-xr-x 4 root root 1024 Sep 24 22:26 boot

drwxr-xr-x 2 root root 4096 Sep 24 22:27 bin

drwxr-xr-x 14 root root 4096 Sep 24 22:27 lib

drwxr-xr-x 21 root root 4096 Sep 24 22:29 var

drwxr-xr-x 2 root root 12288 Sep 24 22:31 sbin

dr-xr-xr-x 141 root root 0 Sep 24 22:34 proc

drwxr-xr-x 11 root root 0 Sep 24 22:34 sys

drwxr-xr-x 2 root root 0 Sep 24 22:34 misc

drwxr-xr-x 2 root root 0 Sep 24 22:34 net

drwxr-xr-x 11 root root 4320 Sep 24 22:43 dev

drwxr-xr-x 3 root root 4096 Sep 24 22:45 media

drwxr-xr-x 4 root root 4096 Sep 24 22:46 dump

drwxr-xr-x 91 root root 4096 Sep 24 22:46 etc

drwxrwxr-x 9 root root 4096 Sep 24 22:57 j2sdk1.4.2_12

drwxrwxrwt 11 root root 4096 Sep 24 22:58 tmp

drwxr-x--- 15 root root 4096 Sep 24 22:58 root

[root@localhost /]# chmod 777 j2sdk-1_4_2_12-linux-i586.rpm

[root@localhost /]# rpm -Uvh j2sdk-1_4_2_12-linux-i586.rpm

Preparing... ########################################### [100%]

1:j2sdk ########################################### [100%]

[root@localhost /]# which java

/usr/bin/java

[root@localhost /]# java -fullversion

java full version "gcj-1.4.2"

[root@localhost /]# alternatives --config java

There is 1 program that provides 'java'.

Selection Command

-


*+ 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java

Enter to keep the current selection[+], or type selection number:

[root@localhost /]# ls -l /usr/bin/java

lrwxrwxrwx 1 root root 22 Sep 24 22:28 /usr/bin/java -> /etc/alternatives/java

[root@localhost /]# echo $JAVA_HOME

[root@localhost /]#

-


Regards

Ahsan

Edited by: Ahsan Rizvi on Sep 30, 2010 7:29 AM

former_member204746
Active Contributor
0 Kudos

hi,

you forgot to set environment variable JAVA_HOME

set it to /usr/bin/java

Former Member
0 Kudos

Dear Eric,

I have already set environment variable JAVA_HOME.

[root@localhost /]# export JAVA_HOME=/usr/java/j2re1.4.2_12/bin

[root@localhost /]# export PATH=$PATH:/usr/java/j2re1.4.2_12

However the result is below.

root@localhost /# which java

/usr/bin/java

root@localhost /# java -fullversion

java full version "gcj-1.4.2"

Please correct me if I'm not understanding anything.

Warm Regards

Ahsan

former_member188883
Active Contributor
0 Kudos

Hi,

Please use the below mentioned commands

export JAVA_HOME=/usr/java/j2re1.4.2_12

export PATH=$PATH:/usr/java/j2re1.4.2_12/bin

Just a slight modification in your command.

Regards,

Deepak Kori

hannes_kuehnemund
Active Contributor
0 Kudos

Dear Ahsan,

the reason behind Deepak suggestion is, that the $PATH variable checks the path from the first given directory to the last given directory. If you place the /usr/java/j2re1.4.2_12 path at the end of the $PATH variable, if will still use a java that is found earlier in the path. Therefore, make sure that /usr/java/j2re1.4.2_12 comes first. With this you ensure that this directory is searched first.

Basically, $PATH variables are very basics in IT and work the same on Windows and UNIX systems. It is quite strange that you bypassed this concept until now

Thanks, Hannes

Former Member
0 Kudos

Hi

Try this,

#cd /usr/bin

#mv java javadef

#ln -s /usr/j2re1.4.2_12/bin/java /usr/bin/java

Regards

Uday

Former Member
0 Kudos

Dear Markus,

Please find the steps I am following to install JAVA on Linux. Please let me know where I am creating mistake. Please note that I'm installing Java for SAP on 32 bit server.

-


[root@localhost dump]# chmod 777 .

[root@localhost dump]# ls -ltr

total 153228

-rwxrwxrwx 1 root root 35513469 May 10 2006 j2sdk-1_4_2_12-linux-i586.rpm

-rwxrwxrwx 1 root root 682914 Jul 3 2008 saplocales-2.5-2.i386.rpm

-rwxrwxrwx 1 root root 93425 Nov 25 2009 compat-libstdc++-296-2.96-141.i386.rpm

-rwxrwxrwx 1 root root 35184545 Sep 20 17:30 j2sdk-1_4_2_12-linux-i586-rpm.bin

-rwxrwxrwx 1 root root 36337163 Sep 20 18:09 j2sdk-1_4_2_12-linux-i586.bin

drwx------ 2 root root 16384 Sep 24 19:45 lost+found

-rwxrwxrwx 1 root root 20694516 Oct 18 2010 jre-6u21-linux-i586-rpm.bin

-rwxrwxrwx 1 root root 13834943 Oct 19 2010 j2re-1_4_2_12-linux-i586-rpm.bin

-rwxrwxrwx 1 root root 14339018 Oct 19 2010 j2re-1_4_2_12-linux-i586.bin

[root@localhost dump]# ./j2re-1_4_2_12-linux-i586-rpm.bin

Sun Microsystems, Inc.

Binary Code License Agreement

for the

JAVATM 2 RUNTIME ENVIRONMENT (J2RE), STANDARD EDITION,

VERSION 1.4.2_X

Do you agree to the above license terms? [yes or no] yes

Unpacking...

Checksumming...

0

0

Extracting...

UnZipSFX 5.40 of 28 November 1998, by Info-ZIP

inflating: j2re-1_4_2_12-linux-i586.rpm

Done.

[root@localhost dump]# ls -ltr

total 166960

-rw-rr 1 root root 14040017 May 10 2006 j2re-1_4_2_12-linux-i586.rpm

-rwxrwxrwx 1 root root 35513469 May 10 2006 j2sdk-1_4_2_12-linux-i586.rpm

-rwxrwxrwx 1 root root 682914 Jul 3 2008 saplocales-2.5-2.i386.rpm

-rwxrwxrwx 1 root root 93425 Nov 25 2009 compat-libstdc++-296-2.96-141.i386.rpm

-rwxrwxrwx 1 root root 35184545 Sep 20 17:30 j2sdk-1_4_2_12-linux-i586-rpm.bin

-rwxrwxrwx 1 root root 36337163 Sep 20 18:09 j2sdk-1_4_2_12-linux-i586.bin

drwx------ 2 root root 16384 Sep 24 19:45 lost+found

-rwxrwxrwx 1 root root 20694516 Oct 18 2010 jre-6u21-linux-i586-rpm.bin

-rwxrwxrwx 1 root root 13834943 Oct 19 2010 j2re-1_4_2_12-linux-i586-rpm.bin

-rwxrwxrwx 1 root root 14339018 Oct 19 2010 j2re-1_4_2_12-linux-i586.bin

[root@localhost dump]# chmod 777 j2re-1_4_2_12-linux-i586.rpm

[root@localhost dump]# cd /

[root@localhost /]# rpm -Uvh /dump/j2re-1_4_2_12-linux-i586.rpm

Preparing... ########################################### [100%]

1:j2re ########################################### [100%]

[root@localhost /]# which java

/usr/bin/which: no java in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin)

[root@localhost /]# java -version

bash: java: command not found

[root@localhost /]# export JAVA_HOME=/usr/java/j2re1.4.2_12

[root@localhost /]# export PATH=$PATH:/usr/java/j2re1.4.2_12

[root@localhost /]# export JAVA_HOME=/usr/java/j2re1.4.2_12/bin

[root@localhost /]# env

SSH_AGENT_PID=2999

HOSTNAME=localhost.localdomain

DESKTOP_STARTUP_ID=

SHELL=/bin/bash

TERM=xterm

HISTSIZE=1000

GTK_RC_FILES=/etc/gtk/gtkrc:/root/.gtkrc-1.2-gnome2

WINDOWID=50331729

OLDPWD=/dump

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:

GNOME_KEYRING_SOCKET=/tmp/keyring-xO6bFF/socket

SSH_AUTH_SOCK=/tmp/ssh-QhbwSH2940/agent.2940

SESSION_MANAGER=local/localhost.localdomain:/tmp/.ICE-unix/2940

MAIL=/var/spool/mail/root

DESKTOP_SESSION=default

PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/java/j2re1.4.2_12

GDM_XSERVER_LOCATION=local

INPUTRC=/etc/inputrc

PWD=/

JAVA_HOME=/usr/java/j2re1.4.2_12/bin

XMODIFIERS=@im=none

LANG=en_US.UTF-8

GDMSESSION=default

SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass

HOME=/root

SHLVL=2

GNOME_DESKTOP_SESSION_ID=Default

LOGNAME=root

CVS_RSH=ssh

DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-u5Zubm461a,guid=33b69c4c402aa6d9fde81c5ea4b14700

LESSOPEN=|/usr/bin/lesspipe.sh %s

DISPLAY=:0.0

G_BROKEN_FILENAMES=1

COLORTERM=gnome-terminal

XAUTHORITY=/tmp/.gdm714HJV

_=/bin/env

[root@localhost /]# $echo $PATH

bash: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/java/j2re1.4.2_12: No such file or directory

[root@localhost /]#

-


Hope you will guide me towards the right direction.

Warm Regards

Ahsan

Edited by: Ahsan Rizvi on Sep 24, 2010 8:30 AM

markus_doehr2
Active Contributor
0 Kudos

> Please find the steps I am following to install JAVA on Linux. Please let me know where I am creating mistake. Please note that I'm installing Java for SAP on 32 bit server.

32bit Linux uses the Sun JDK, so forget about the IBM one. The IBM JDK is used only on x86_64

> -rwxrwxrwx 1 root root 35513469 May 10 2006 j2sdk-1_4_2_12-linux-i586.rpm

Any reason why you use such an old JDK? The current one is 1.4.2_27, I download that one and install it.

To find out where it's been installed used

rpm -qlp <rpm package>

To actually use it you have to change the environment.

Markus

Former Member
0 Kudos

Dear Zach,

Please find the result below after performing your given suggestions.

-


[root@localhost /]# which java

/usr/bin/java

[root@localhost /]# java -version

java version "1.4.2"

gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)

Copyright (C) 2006 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost /]# ls -ltr

total 70406

-rw-rr 1 root root 35513469 May 10 2006 j2sdk-1_4_2_12-linux-i586.rpm

drwxr-xr-x 2 root root 4096 Oct 11 2006 srv

drwxr-xr-x 2 root root 4096 Oct 11 2006 opt

drwxr-xr-x 2 root root 4096 Oct 11 2006 mnt

drwxr-xr-x 2 root root 4096 Oct 11 2006 home

-rwxrwxrwx 1 root root 36337163 Sep 20 18:09 j2sdk-1_4_2_12-linux-i586.bin

drwx------ 2 root root 16384 Sep 24 22:18 lost+found

drwxr-xr-x 3 root root 4096 Sep 24 22:20 sapmnt

drwxr-xr-x 3 root root 4096 Sep 24 22:21 oracle

drwxr-xr-x 2 root root 4096 Sep 24 22:22 selinux

drwxr-xr-x 15 root root 4096 Sep 24 22:25 usr

drwxr-xr-x 4 root root 1024 Sep 24 22:26 boot

drwxr-xr-x 2 root root 4096 Sep 24 22:27 bin

drwxr-xr-x 14 root root 4096 Sep 24 22:27 lib

drwxr-xr-x 21 root root 4096 Sep 24 22:29 var

drwxr-xr-x 2 root root 12288 Sep 24 22:31 sbin

dr-xr-xr-x 141 root root 0 Sep 24 22:34 proc

drwxr-xr-x 11 root root 0 Sep 24 22:34 sys

drwxr-xr-x 2 root root 0 Sep 24 22:34 misc

drwxr-xr-x 2 root root 0 Sep 24 22:34 net

drwxr-xr-x 11 root root 4320 Sep 24 22:43 dev

drwxr-xr-x 3 root root 4096 Sep 24 22:45 media

drwxr-xr-x 4 root root 4096 Sep 24 22:46 dump

drwxr-xr-x 91 root root 4096 Sep 24 22:46 etc

drwxrwxr-x 9 root root 4096 Sep 24 22:57 j2sdk1.4.2_12

drwxrwxrwt 11 root root 4096 Sep 24 22:58 tmp

drwxr-x--- 15 root root 4096 Sep 24 22:58 root

[root@localhost /]# chmod 777 j2sdk-1_4_2_12-linux-i586.rpm

[root@localhost /]# rpm -Uvh j2sdk-1_4_2_12-linux-i586.rpm

Preparing... ########################################### [100%]

1:j2sdk ########################################### [100%]

[root@localhost /]# which java

/usr/bin/java

[root@localhost /]# java -fullversion

java full version "gcj-1.4.2"

[root@localhost /]# alternatives --config java

There is 1 program that provides 'java'.

Selection Command

-


*+ 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java

Enter to keep the current selection[+], or type selection number:

[root@localhost /]# ls -l /usr/bin/java

lrwxrwxrwx 1 root root 22 Sep 24 22:28 /usr/bin/java -> /etc/alternatives/java

[root@localhost /]# echo $JAVA_HOME

[root@localhost /]#

-


Regards

Ahsan

former_member189546
Active Contributor
0 Kudos

Hello,

There is a download page solely for SAP customers:

http://www.sun.com/software/javaforbusiness/sap_download.jsp

Please see note...

Note 716604 for the Sun JDK (Windows, Linux, Solaris)

regards,

John Feely

Former Member
0 Kudos

Ahsan,

# Java -fullversion
gives details of by default installed java.

I believe you are trying to say that this command returns the version of Java installed by default. You may need to use the "alternatives" system inorder for your environment to use a specific java installation. (Install via rpm, right?) Check what the table of "/usr/sbin/alternatives --config java" contains.

*Is /usr/bin/java a symbolic link to another executable?

    • ls -l /usr/bin/java

*What does the following return?

    • echo $JAVA_HOME

-zach

markus_doehr2
Active Contributor
0 Kudos

> # Java -fullversion

> gives details of by default installed java.

So what output do you get there?

Markus