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 - Development and Darwin Discussion and questions about development for Mac OS X.

A simple example for calling an existing java code from c using jni?


Post Reply New Thread Subscribe

 
Thread Tools
missshirin

 
Member Since: Oct 14, 2010
Posts: 1
missshirin is on a distinguished road

missshirin is offline
I have an existing java code and I want to use its function in c language. As I found till now I should use jni. I have read a sample in this link:
Java programming with JNI
If I want to compile the c code with the command below I have to change the code a little.Because of the last sentence that has mentioned in this link:
Re: JNI NIO early compilation error

I use these command to compile:
g++ -framework -I/System/Library/Frameworks/JavaVm.fram… -c Sample2.c -o Sample2.o
I got this as result :
i686-apple-darwin10-g++-4.2.1: cannot specify -o with -c or -S with multiple files

and it doesn't work! and I don't know how should I compile and run it.:-(
and I even know what's wrong with that!
Can you please put any comment on this ? Or do you know another way to do what I'm going to do.
thanks.
QUOTE Thanks

Post Reply New Thread Subscribe


« mod, file was built for unsupported file format which is not the architecture linked | Xcode and running unit tests »
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
Thread Starter
Forum
Replies
Last Post
Snow Leopard > Firefox 3.6 > Java not working... slater OS X - Apps and Games 6 04-03-2011 10:03 AM
JNI with Xcode 3.0 - Adding Java Package niroshpg OS X - Operating System 2 05-28-2009 08:57 AM
AN ultra simple Java app develpoment studio? indykid Web Design and Hosting 0 07-04-2005 03:01 PM
Java From Terminal jdgti OS X - Development and Darwin 10 03-26-2005 07:16 PM
Code Editor (Java) pitythefool OS X - Apps and Games 0 02-22-2005 11:07 AM

All times are GMT -4. The time now is 12:16 PM.

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

Welcome to Mac-Forums.com

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?