tarzanking / javacpp

Automatically exported from code.google.com/p/javacpp
GNU General Public License v2.0
0 stars 0 forks source link

javacpp does not find jni.h on OS X Lion #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open any JavaCPP-dependent project in NetBeans (i.e. javacv)
2. Run -> Clean and Build Main Project

What is the expected output? What do you see instead?

Successful output is expected.

 What I see instead:

init:
Deleting: 
/Users/alterscape/src/javacv-read-only/javacv/build/built-jar.properties
deps-jar:
Updating property file: 
/Users/alterscape/src/javacv-read-only/javacv/build/built-jar.properties
javacpp.init:
javacpp.deps-jar:
Updating property file: 
/Users/alterscape/src/javacv-read-only/javacv/build/built-jar.properties
javacpp.compile:
Building jar: /Users/alterscape/src/javacpp-read-only/javacpp/dist/javacpp.jar
To run this application from the command line without Ant, try:
java -cp "/Users/alterscape/src/javacpp-read-only/javacpp/dist/javacpp.jar" 
com.googlecode.javacpp.Builder
Deleting: /Users/alterscape/src/javacpp-read-only/javacpp/dist/README.TXT
Copying 1 file to /Users/alterscape/src/javacpp-read-only/javacpp/dist
javacpp.jar:
Copying 6 files to /Users/alterscape/src/javacv-read-only/javacv/build/classes
Generating source file: 
/Users/alterscape/src/javacv-read-only/javacv/build/classes/com/googlecode/javac
v/cpp/jniopencv_core.cpp
Building library file: 
/Users/alterscape/src/javacv-read-only/javacv/build/classes/com/googlecode/javac
v/cpp/macosx-x86_64/libjniopencv_core.dylib
g++ -I./ 
/Users/alterscape/src/javacv-read-only/javacv/build/classes/com/googlecode/javac
v/cpp/jniopencv_core.cpp -march=x86-64 -m64 -Wall -O3 -fPIC -dynamiclib -o 
/Users/alterscape/src/javacv-read-only/javacv/build/classes/com/googlecode/javac
v/cpp/macosx-x86_64/libjniopencv_core.dylib -L/usr/local/lib/ -lopencv_core 
/Users/alterscape/src/javacv-read-only/javacv/build/classes/com/googlecode/javac
v/cpp/jniopencv_core.cpp:17:17: error: jni.h: No such file or directory

(... more errors follow, a result of missing things that are defined in 
jni.h...)

What version of the product are you using? On what operating system?

javacpp / opencv cloned from google code svn. Compiling on OS X 10.7.1

Please provide any additional information below.

As per 
http://code.google.com/p/javacpp/source/browse/trunk/javacpp/src/com/googlecode/
javacpp/Builder.java?spec=svn10&r=10 lines 47-74, javacpp searches for jni.h up 
to four levels deep in the java.home directory.

On OS X, my java.home resolves to 
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home.

The results of $locate jni.h:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.
sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Versio
ns/A/Headers/jni.h
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/JavaVM.framework/Versio
ns/A/Headers/jni.h
/Developer-old/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaVM.framework/Ve
rsions/1.4.2/Headers/jni.h
/Developer-old/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaVM.framework/Ve
rsions/1.5.0/Headers/jni.h
/Developer-old/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaVM.framework/Ve
rsions/1.6.0/Headers/jni.h
/Developer-old/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaVM.framework/Ve
rsions/A/Headers/jni.h
/Developer-old/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Ve
rsions/1.6.0/Headers/jni.h
/Developer-old/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Ve
rsions/A/Headers/jni.h
/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h

I can manually modify my javacpp to hardcode the jni.h path, but I'd rather a 
fix get integrated here.

Original issue reported on code.google.com by ryanspi...@gmail.com on 28 Sep 2011 at 9:32

GoogleCodeExporter commented 9 years ago
Hum... They sure did a mess out of this, hey. Would you know by any chance 
which one the current JDK should map to?

Original comment by samuel.a...@gmail.com on 29 Sep 2011 at 1:47

GoogleCodeExporter commented 9 years ago
I am fairly sure that 
/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h is the 
header for the currently active version.  This may be different pre-Snow 
Leopard -- I remember that the way Java is situated in the OS was changed in 
response to some part of the whole Sun-Oracle business, though I don't remember 
exactly how.

Original comment by ryanspi...@gmail.com on 29 Sep 2011 at 3:49

GoogleCodeExporter commented 9 years ago
"/System/Library/Frameworks/JavaVM.framework/Headers/" appears to be the 
generic, standard, link to that path.. Can you confirm that it is still 
available in Lion?

Original comment by samuel.a...@gmail.com on 30 Sep 2011 at 1:37

GoogleCodeExporter commented 9 years ago
I confirm that the "/System/Library/Frameworks/JavaVM.framework/Headers/" link 
is still good on 10.7.1.

Original comment by ryanspi...@gmail.com on 30 Sep 2011 at 4:33

GoogleCodeExporter commented 9 years ago
Great! Fixed in latest release

Original comment by samuel.a...@gmail.com on 1 Oct 2011 at 1:30