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

后端 未结 14 1647
野趣味
野趣味 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:42

    This depends a bit from your package system ... if the java command works, you can type readlink -f $(which java) to find the location of the java command. On the OpenSUSE system I'm on now it returns /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/bin/java (but this is not a system which uses apt-get).


    On Ubuntu, it looks like it is in /usr/lib/jvm/java-6-openjdk/ for OpenJDK, and in some other subdirectory of /usr/lib/jvm/ for Suns JDK (and other implementations as well, I think).

    Debian is the same.


    For any given package you can determine what files it installs and where it installs them by querying dpkg. For example for the package 'openjdk-6-jdk': dpkg -L openjdk-6-jdk

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

    This question will get moved but you can do the following

    which javac
    

    or

    cd /
    find . -name 'javac'
    
    0 讨论(0)
提交回复
热议问题