JNI with Xcode 3.0 - Adding Java Package

Joined
Dec 31, 2008
Messages
2
Reaction score
0
Points
1
Hi all,
I need to create JNI library which can be invoked from a application that implements user defined java packages [ instead of default package ] using XCode 3.0 ( running on OS X 10.5.1 ).

The existing template for JNI application project in Xcode does not use packages. When introduced used define package build fails with error message indicating "cannot access <target name>".

I have done the following.

1. Create new JNI project (TestJNI) using File-> New Project -> Java -> Java JNI Application"

2. Build and run the project.

3. In TestJNI.java add following line.

package TestPackage;

4. Closed the Xcode IDE. Open src folder of the TestJNI project and create sub directory call "TestPackage" and move TestJNI.java file there.

5. Open the project back and perform a clean installation.

This result in a serious of errors and TestJNI.h was never created and it reported following error list ( see attached doc for complete list ).
Line Location build.xml:67: Warning: Could not find file /Users/Nirosh/Projects/JNI/TestJNI/build/Release/libTestJNI.jnilib to copy.
Line Location TestJNIjnilib.c:10: error: TestJNI.h: No such file or directory
Line Location TestJNIjnilib.c:10: error: TestJNI.h: No such file or directory
................
Line Location Tool:0: error: cannot access TestJNI


I hope that I have missed some small point here but could not figure out it yet. Any help on this regard is highly appreciated.


Thanks and Best Regards,
Nirosh

View attachment TestJNI-build-errors.doc
 
Joined
May 28, 2009
Messages
1
Reaction score
0
Points
1
did it work?

I have the same issue after moving the native and java class (and renaiming the native functions accordingly) to a package it no longer compiles (doesn't pull in the javah header), and I have tweaked as much as I can see to tweak.

did you maange to change the BAse JNI project? or did you build it again from scratch using that link?

Regards
Wauyne
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top