Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > java JNI

java JNI
Thread Tools
Fresh-Faced Recruit
Join Date: Sep 2001
Location: France
Status: Offline
Reply With Quote
Sep 9, 2001, 10:38 AM
 
I am a java developer, I use JNI (java native interface) in order to replace some parts of my java code by native C code.
It works fine but I only know how to get my library with projectBuilder as explained here: http://developer.apple.com/qa/java/java28.html

but I come from the world of linux/solaris and with osX I don't find how to get my libmylib.jnilib with a command line (cc)
(with gcc of linux or cc of solaris I know how to get libmylib.so)

So I would be able to compile my library directly with a commad line (with the corrects headers and lib paths).

Thanks in advance
"Microsoft is not the answer,
Microsoft is the question.
NO is the answer." --Unknown
     
Fresh-Faced Recruit
Join Date: Sep 2001
Location: France
Status: Offline
Reply With Quote
Sep 9, 2001, 10:53 AM
 
and I've a econd question:
some people ask me to port my app on windows, but I haven't win.
So is there any crossCompiler that could help me to get mylib.dll from osX?
(always about jni lib of course, in order to keep my java app portable)

If it's impossible, I don't mind, I'll do not port my app for win that's all...
"Microsoft is not the answer,
Microsoft is the question.
NO is the answer." --Unknown
     
Forum Regular
Join Date: Aug 2001
Location: Vienna, Austria
Status: Offline
Reply With Quote
Sep 9, 2001, 12:22 PM
 
<font face = "courier">cc -bundle -I/System/Library/Frameworks/JavaVM.framework/Headers libmylib.c -o libmylib.jnilib</font>

And I don't know of any cross compiler for Windows.
     
Fresh-Faced Recruit
Join Date: Sep 2001
Location: France
Status: Offline
Reply With Quote
Sep 9, 2001, 12:45 PM
 
thanks a lot!
I found the path to the jni.h:
-I/System/Library/Frameworks/JavaVM.framework/Headers
but I missed the "-bundle", I tried -G without success...


thanks again
"Microsoft is not the answer,
Microsoft is the question.
NO is the answer." --Unknown
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 12:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2