Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find JDK directory in Ubuntu for JNI C/C++ library

I am trying to use JNI for my recent project. MY IDE is NetBeans. After creating C/C++ project , I am trying to add JDK directory from project properties->C compiler->include directory. I could not find any include or include/linux directory in /usr/lib/jvm/ directory.

Where should i look for "include" or "include/linux" directory?

like image 367
Habibullah Araphat Konok Avatar asked Apr 30 '13 13:04

Habibullah Araphat Konok


People also ask

Where is my JDK folder 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 .

How do I find my JDK directory?

Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and in system variable try to find JAVA_HOME. This gives me the jdk folder.

Where is JDK folder in Linux?

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.


1 Answers

Assuming you've got a JDK installed the directory should be something like: /usr/lib/jvm/java-7-openjdk-amd64 (assuming OpenJDK 7 here). You might also need to a JAVA_HOME environment variable pointing at the same directory depending on your build process.

If you haven't got a JDK installed you can install the OpenJDK with something like the following in a terminal windows:

sudo apt-get install openjdk-7-jdk
like image 107
GooseSerbus Avatar answered Oct 21 '22 17:10

GooseSerbus