Hello,
I have a makefile, which needs to know the location of the Java include directory because it makes use of the jni.h file. What is the best way of allowing the Makefile to auto-detect where Java is installed on Linux?
Thanks,
Chris
Hello,
I have a makefile, which needs to know the location of the Java include directory because it makes use of the jni.h file. What is the best way of allowing the Makefile to auto-detect where Java is installed on Linux?
Thanks,
Chris
The JAVA_HOME environment variable contains the path to the Java installation.
On Linux you can use the which
command, such as which java
. It should tell you where the location of the java exec it would use is.
However, I'd recommend setting up JAVA_HOME as Erick pointed out.