Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling OS specific API functions

 
Michael Moritzer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Sun tutorial on JNI
http://java.sun.com/docs/books/tutorial/native1.1/concepts/index.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic