This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Calling OS specific API functions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Calling OS specific API functions" Watch "Calling OS specific API functions" New topic

Calling OS specific API functions

Michael Moritzer

Joined: May 28, 2001
Posts: 1
Hello, I am wondering how to call operating specific API functions. The JVM doesn obviously not know anything about them, so I thought about writing a native component that calls the low-level API (e.g. a windows DLL), and then call the exported DLL from within my java class. But how ? Via RMI ? How can I export a function from a native component so that a java class can invoke it ?
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
no you would't need RMI , but you would need JINI to be able to call the native methods. After registring the dll with the system you can use java api to load these libriaries and then work with them.

Val SCJP <BR>going for SCJD
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
The Sun tutorial on JNI

"JavaRanch, where the deer and the Certified play" - David O'Meara
rocket mass heater kickstarter
subject: Calling OS specific API functions