Section 2.2. Java Environment


2.2. Java Environment

More and more applications today are being developed using the Java programming language. One can assume that porting a Java application is relatively easier than porting applications that were developed in other programming languages such as C or C++. However, our experience shows that not all Java Development Kits (JDKs) are created equally, which can make porting Java applications not as easy as first assumed.

All JDKs are expected to follow the Java specifications[14] set forth by Sun. However, implementation specifics are left to the vendor. Most vendors include helper classes that provide functionalities to implement specific Java application programming interfaces (APIs). These helper classes are not hidden from the Java developer and hence can be used as if they are part of the JDK specification. This is okay as long as the JDK includes this helper class. When the application is run on a Java Runtime Environment (JRE) from a different vendor that uses different helper classes, however, the application will fail to find that specific class. This problem can easily escalate to a suspicion of a bug with the Java implementation that does not have the same helper class as the original JDK. The solution here is to not use helper classes included in the JDK that are not part of the Java API specification. Expect this and other similar problems to crop up from time to time when doing a port of a Java application.

[14] http://java.sun.com/reference/api/index.html

Several JVM distributions for Linux can be downloaded from different Web sites:

  • JDK from Blackdown (www.blackdown.org/)

  • JDK from IBM (www.ibm.com/developerworks/java/jdk/linux/download.html)

  • JDK from Sun (www.java.com/en/download/manual.jsp)

When porting Java applications from other platforms to Linux, be aware that some JVM switches used to start the JVM on other platforms may not exist on the JVM available for Linux. These switches are used on the specific platform to make the JVM and the Java application run as optimally as possible on that platform. Use of these specific switches depends on their availability from the JVM distributions just mentioned.




UNIX to Linux Porting. A Comprehensive Reference
UNIX to Linux Porting: A Comprehensive Reference
ISBN: 0131871099
EAN: 2147483647
Year: 2004
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net