Summary

Bruce Eckel's Thinking in Java Contents | Prev | Next

What you’ve seen in this appendix are the most common techniques to call non-Java code from a Java application. Each technique has its pros and cons, but currently the major problem is that not all of these features are available on all JVMs, so a Java program that calls native methods on a specific platform might not work on a different platform with a different JVM.

Sun’s JNI is flexible, reasonably simple (although it requires a lot of control over the JVM internals), powerful, and it’s available on most JVMs, but not all. Microsoft, at the time of this writing, does not support JNI, but offers J/Direct, a simple way to call Win32 DLL functions, and RNI, which is designed for high-performance code but requires a good understanding of the JVM internals. Microsoft also offers its proprietary Java/COM integration feature, which is powerful and makes Java an interesting language for writing COM servers and clients. J/Direct, RNI, and Java/COM integration are supported only by the Microsoft compiler and JVM.

Finally, we took a look at CORBA, which allows your Java objects to talk to other objects regardless of their physical location and implementation language. CORBA is different from the techniques above because it is not integrated with the Java language, but instead uses third-party integration technology and requires that you buy a third-party ORB. CORBA is an interesting and general solution, but it might not be the best approach if you just want to make calls into the operating system.



Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Open source and cloud computing have long promised cost efficiencies, yet many organizations have shied away from these technologies due to security and reliability concerns. Now, open source has proven itself stable, and the cloud has become as secure—or even more secure—than on-premises implementations. Read this white paper to learn how you can get the accessibility of open source and the flexibility and affordability of cloud computing combined in a compelling storage option for companies …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds