Where can I find the Java SDK in Linux after installing it?

后端 未结 14 1648
野趣味
野趣味 2020-12-02 03:59

I installed JDK using apt-get install but I don\'t know where my jdk folder is. I need to set the path for that. Does any one have a clue on the location?

相关标签:
14条回答
  • 2020-12-02 04:25

    on OpenSUSE 13.1/13.2 its: /usr/lib64/jvm/java-1.6.0-openjdk-(version-number)
    version-number can be 1.7.x 1.8.x etc. check software manager witch version you have installed...

    André

    0 讨论(0)
  • 2020-12-02 04:32
    $ which java 
    

    should give you something like

    /usr/bin/java
    
    0 讨论(0)
  • Three Step Process: First: open Terminal->$ whereis java it would give output like this: java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz

    Second: ls -l /usr/bin/java It would give output like this: lrwxrwxrwx 1 root root 22 Feb 9 10:59 /usr/bin/java -> /etc/alternatives/java

    Third: ls -l /etc/alternatives/java output is the JDK path: lrwxrwxrwx 1 root root 46 Feb 9 10:59 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

    0 讨论(0)
  • 2020-12-02 04:37

    Another best way to find Java folder path is to use alternatives command in Fedora Linux (I know its for Ubuntu but I hit this post from google just by its headline). Just want to share incase people like me looking for answers for fedora flavour.

    To display all information regarding java

    alternatives --display java
    
    0 讨论(0)
  • 2020-12-02 04:39

    the command: sudo update-alternatives --config java will find the complete path of all installed Java versions

    0 讨论(0)
  • 2020-12-02 04:40

    below command worked in my debain 10 box!

    root@debian:/home/arun# readlink -f $(which java)
    /usr/lib/jvm/java-11-openjdk-amd64/bin/java
    
    0 讨论(0)
提交回复
热议问题