Link to home
Start Free TrialLog in
Avatar of pvinodp
pvinodp

asked on

"which java" is not wokring

In my java aplication, hosted on jboss, there is a this situation:
# jre is installed
# but I dont get any thing if a execute "which java"
# executing "java -version" also does not work.
So commands like java -cp [XYZ] give error like
java: command not found
Any help?

SOLUTION
Avatar of whyitellu
whyitellu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pvinodp
pvinodp

ASKER

In a production server it is not necessary to install jdk. I think it is for development purpose.

It has jre installed. And another system in the cluster is also in the same state : jre installed and nothing in .bashrc except sourcing  /etc/bashrc.

But the command which java , java -version , and java -cp works in that system.

Any clue now?
Avatar of pvinodp

ASKER

I've requested that this question be deleted for the following reason:

We are still unable to solve the ssue. I am goging to delete this question. Kindly revert in case u have any other steps...
I just used '/usr/java/jdk.version/bin/' as an example.

Did you run the locate and/or find commands?

Bottom line -- if java is installed, but not showing up when you issue 'which java', then it is not in your path.
Avatar of pvinodp

ASKER

ok. but how do u set it?
I dont want to disturb .bashrc on the affected system [sysA].
 I insist this because another system [sysB] in the cluster has the same content in .bashrc and it does return the path /usr/bin/java on executing "which java".

but the sysA does show installation of jre.
Still waiting to hear if you got any results from the find or locate commands I originally posted.

Add this to this list:
rpm -qa|grep -i java

Open in new window

Avatar of pvinodp

ASKER

The locate java and find java command resulted in showing the installed jre 1.4 .
I cant access the system right now... It is at the customer lab .. I shall try "rpm -qa****" and let you know..
Any other way u think of mentioning? Because i get only limited time to check on the system.

Which Linux distro and version are you running?  How did you install the jre?
Objecting as "Far from done".
Avatar of pvinodp

ASKER

it is rhel5 .. I am not sure, but they would have installed using rpm -ivh jre1.4$$$.rpm
Avatar of pvinodp

ASKER

Thanks all for your contribution