New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

OS 10.5 - JNI with Xcode 3.0 - Adding Java Package

Post Reply New Thread Subscribe

Thread Tools

Member Since: Dec 31, 2008
Posts: 2
niroshpg is on a distinguished road

niroshpg is offline
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 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 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,
Attached Files
File Type: doc TestJNI-build-errors.doc (22.5 KB, 1 views)
QUOTE Thanks

Member Since: Dec 31, 2008
Posts: 2
niroshpg is on a distinguished road

niroshpg is offline
It seems that

Building a JNI Universal Application with Xcode 3.0 -- BONNOH FRACTION 13

approach can be used to implement Java Packages with JNI in Xcode 3.0.

Still working on confirming this solution ....

Thanks and best Regards,
QUOTE Thanks

Member Since: May 28, 2009
Posts: 1
wkeenan is on a distinguished road

wkeenan is offline
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?

QUOTE Thanks

Post Reply New Thread Subscribe

« Mail not receiving emails | Can't see my NTFS partition »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
Old XCode and 3.0? raydot OS X - Development and Darwin 0 03-27-2008 12:07 AM
Newbie programmer needs JAVA help in XCODE zeroelink OS X - Development and Darwin 1 02-02-2006 11:42 AM
Java From Terminal jdgti OS X - Development and Darwin 10 03-26-2005 07:16 PM
Java and xcode FishStickBoy OS X - Development and Darwin 1 09-28-2004 10:42 PM

All times are GMT -4. The time now is 04:41 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?