Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

linux

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?

like image 298
dinesh707 Avatar asked Mar 09 '11 19:03

dinesh707


People also ask

Where is java SDK installed?

The JDK software is installed on your computer, for example, at C:\Program Files\Java\jdk1. 6.0_02.

How do I know if java SDK is installed?

Open command prompt and enter “java –version”. If installed version number is displayed. 2. On Windows, Java is usually installed in the directory C:/Program Files/Java.

Where is java SDK installed Ubuntu?

OpenJDK 11 is located at /usr/lib/jvm/java-11-openjdk-amd64/bin/java. Oracle Java is located at /usr/lib/jvm/java-11-oracle/jre/bin/java .

Where is my java SDK Linux?

Alternatively, you can use the whereis command and follow the symbolic links to find the Java path. The output tells you that Java is located in /usr/bin/java. Inspecting the directory shows that /usr/bin/java is only a symbolic link for /etc/alternatives/java.


1 Answers

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

like image 131
Paŭlo Ebermann Avatar answered Oct 10 '22 13:10

Paŭlo Ebermann