Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Native Programming

Thread view: 
Rawash - 16 Nov 2005 06:57 GMT
Can someone tell me, how one can do native programming?
Gordon Beaton - 16 Nov 2005 06:44 GMT
> Can someone tell me, how one can do native programming?

The short description:

- write your java code, declaring one or more methods "native" and
 making sure the shared library that will contain the native methods
 is loaded before any native methods are invoked

- compile the java code

- run javah to get a header file containing native declarations of the
 native methods

- implement the native methods in e.g. C or C++ (or really any
 language with a C binding), using the header file as reference

- compile your native code to a shared library or DLL and put it where
 the JVM can find it, i.e. one of the places mentioned in
 java.library.path

If you want a more detailed explanation, start reading:

 http://www.amazon.com/exec/obidos/ASIN/0201325772
 http://www.amazon.com/exec/obidos/ASIN/0136798950
 http://java.sun.com/docs/books/tutorial/native1.1/index.html
 http://java.sun.com/j2se/1.5.0/docs/guide/jni/index.html

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

Vitaly - 16 Nov 2005 10:02 GMT
If you use MS VC++ v7.1 you can test the tool at
http://simtel.net/product.php[id]90910[SiteID]simtel.net

> Can someone tell me, how one can do native programming?
Roedy Green - 16 Nov 2005 10:11 GMT
>Can someone tell me, how one can do native programming?

see http://mindprod.com/jgloss/jni.html

Learn C/C++

Get a textbook on JNI
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.