6

Below is the java I installed in ubuntu 16.04, but I am unable to find Javac and Jps in this. Can someone help how to get them.

$ java -version    
openjdk version "1.8.0_131"    
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

$ update-alternatives --get-selections | grep java    
java                           auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java    
jexec                          auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jexec    
jjs                            auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/jjs    
keytool                        auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool    
orbd                           auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/orbd    
pack200                        auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/pack200    
rmid                           auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmid    
rmiregistry                    auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmiregistry    
servertool                     auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/servertool   
tnameserv                      auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/tnameserv   
unpack200                      auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/unpack200

I am unable to see JPS and JAVAC. Can anyone help?

muru
  • 197,895
  • 55
  • 485
  • 740

4 Answers4

4

How did you install java 8?

Perhaps you installed only JRE?

sudo apt-get install openjdk-8-jre

This will install java run time environment, typically in:

/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

When you should have done:

sudo apt-get install openjdk-8-jdk

Which shall install compiler in (usually):

/usr/lib/jvm/java-8-openjdk-amd64/bin/javac

If you can't get openjdk to work you can try Oracles java via www.webupd8.org

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

That results in:

java -version
  java version "1.8.0_131"
  Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
  Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)<br>

which javac
/usr/bin/javac

Which links to:

  /usr/lib/jvm/java-8-oracle/bin/javac
  • (When you should have done:

    sudo apt-get install openjdk-8-jdk)

    I installed the same, but no luck. I am not seeing either Javac or JPS.

    – chandrapvs Jun 14 '17 at 00:46
4

I resolved the issue by running the below command, simply installing all the java packages.

sudo apt-get install openjdk-8*

Wish I'd done it in the first place. Thanks all for your replies.

Zanna
  • 70,465
0

In Amazon Linux, the yum package with just the JRE is called java-1.8.0-openjdk and the yum package with the JRE and JDK is called java-1.8.0-openjdk-devel.

If this is your issue, the solution would be adding the -devel to your yum install command: yum install java-1.8.0-openjdk-devel -y

I agree calling the package with the JRE, "jdk" is dumb so don't hate on the messenger.

0

Go to exact path/usr/local/java/jdk-8u211-linux-x64/jdk1.8.0_211/bin execute ./jps you can see all sunning hadoop nodes