Since this question is RPM specific, rpm is the way to get started (as by ). Rpm flags -q is short for -query -l is short for -list Example rpm -ql jdk1.8.020 grep 'jdk1.8.020/bin$' /usr/java/jdk1.8.020/bin Knowing this may be desirable for setting a user or application's $JAVAHOME variable. This is often needed when a system has multiple versions of java installed, or multiple distributions of java installed, such as. $JAVAHOME Example In the /.bashprofile, or related file (.bashrc,.zshrc,.cshrc, setenv.sh), something similar to the below may be used. JAVAHOME='/usr/java/jdk1.8.020' export JAVAHOME PATH='$JAVAHOME/bin:$PATH' export PATH If you would like more control over where Java gets installed, such as in /opt, then the tarball can be used instead of the RPM file. Other similar questions, are asking about how to find any binary or file, in the general case.
![Catia Catia](/uploads/1/2/5/4/125420065/732544886.png)
![Home Home](http://2.bp.blogspot.com/-wyQtyf3IjSs/U75gWv3lDuI/AAAAAAAAGxU/iPbNK2n2RJw/s1600/Java_home_error.jpg)
If you have root or administrator privileges, set the $JAVA_HOME variable to Java's directory location for all users system-wide. If you only need to set the path.
You didn't specify a shell. So, I will assume bash. The next issue is: did you set it for your user only or system-wide? If you set it for your user only, then run: grep JAVAHOME /.bashprofile /.bashlogin /.profile /.bashrc If you set it system-wide, then it may vary with distribution but try: grep JAVAHOME /etc/environment /etc/bash.bashrc /etc/profile.d/. /etc/profile If the above give no answer, you can cast a wider net: grep -r JAVAHOME /etc grep -r JAVAHOME / See also the suggestions in.