[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

"which java" is not wokring

Posted on 2011-09-12
12
Medium Priority
?
217 Views
Last Modified: 2012-08-13
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?

0
Comment
Question by:pvinodp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 

Assisted Solution

by:whyitellu
whyitellu earned 400 total points
ID: 36523602
First Check that Java is Properly installed or not?

if installed then try for java -v

and don't forget to set Class path for java (u can easily googling )

still problem then try to install Latest JDK .

and after that not solved then post related output/data.
0
 
LVL 21

Accepted Solution

by:
Papertrip earned 1600 total points
ID: 36524013
This is just a path problem, need to find the actual install directory for java, and either add that to your path or create symlinks to someplace like /usr/bin.

First off start looking in like /usr/java/jdk.version/bin/

If you don't see it there, try using 'locate java|grep bin'.  If that doesn't work then use 'find / -name java -type f'

Once you find the path, you can add that to the PATH envvar for your shell.  Here are instructions on how to add setup JAVA_HOME and PATH.

The other choice is creating a symlink to a directory that is in your path. For example, 'ln -s /usr/java/jdk6/bin/java /usr/bin/java'
0
 

Author Comment

by:pvinodp
ID: 36527483
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?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:pvinodp
ID: 36813251
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...
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36813069
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.
0
 

Author Comment

by:pvinodp
ID: 36813187
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.
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36813198
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

0
 

Author Comment

by:pvinodp
ID: 36813231
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.

0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36813248
Which Linux distro and version are you running?  How did you install the jre?
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36813252
Objecting as "Far from done".
0
 

Author Comment

by:pvinodp
ID: 36813695
it is rhel5 .. I am not sure, but they would have installed using rpm -ivh jre1.4$$$.rpm
0
 

Author Closing Comment

by:pvinodp
ID: 37492583
Thanks all for your contribution
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question