× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Compile Java using different JDK versions on AS400
  • From: "Larry Loen" <lwloen@xxxxxxxxxx>
  • Date: Fri, 13 Apr 2001 10:53:23 -0500
  • Importance: Normal


First, let me belabor the obvious about run-time implications of the
compiles.

If your source compiles under both 1.1 and 1.2, then I have always been
able to compile it under 1.1 and use the resulting class files under both
1.1 and 1.2.

However, things compiled under 1.2 with javac can be marked in such a way
that 1.1 does not run them, thinking them uplevel in some way, even if you
don't use 1.2 classes.

I would still do CRTJVAPGM on the resulting class files if you want the
best performance -- if there are interoperability problems between 1.1 and
1.2, I haven't run into them with or without CRTJVAPGM, though of course
there can always be bugs.  This matters as you may be able to have a 1.1
version serve both 1.1 and 1.2 apps instead of two jar files or some such
thing.

Keep in mind that the OS/400 JVM is more closely tied, in the end, to the
OS/400 than the Java level.  Our JVM tends to support multiple, specified
Java versions in the context of one OS/400 release.  Other JVMs tend to be
self-contained.  Support for a given Java version is based on possessing
that particular version's JVM on other boxes.

This difference is ordinarily invisible, but it may help a little here when
you get down to actually running classes.

Now, on to javac.  If you do the actual javac on the '400, then be sure
that you are running javac using the Java version you want.  The
documentation describes, for running javac under QShell, how to specify a
version.

It says:

If you have JDK 1.1.x installed on AS/400 as your default, but you need to
run the 1.2 version of the java command, enter this command:

javac -djava.version=1.2   MyProgram.java



Obviously, this should work the other way around.



Larry W. Loen  -   Senior Java and iSeries Performance Analyst
                          Dept HP4, Rochester MN


+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.