## Java on OS/2: Frequently Asked Questions

Note: At the moment this FAQ has not been fully updated to reflect changes in the JDK for version 1.1. I have not had time to download or work with the new JDK at all yet, but I would appreciate any information that's available on this, especially on working at both JDK levels on one machine.

This is an attempt to bring together information on the Java language for OS/2. Note: Nothing here is official IBM information. Opinions expressed here are strictly my own.

Q. First off, what is Java?

A. For general information on Java, check out the comp.lang.java FAQ. This is a very good introduction that contains pointers to other sources of information.

Q. How do I get a version of Java for OS/2?

A. The official source is the IBM web site. You will need to fill out a registration form. After successfully filling out the form, you will receive e-mail confirmation of your registration, and will be allowed to access the development area for OS/2 for OS/2. Available there for download are the JDK itself and documentation in HTML and PostScript. You can also read the readme file to see if this is really what you want. IBM is now providing FTP downloads for the files, too, if you have trouble getting them from the Web site.

Q. How do I get a Java-enabled browser for OS/2?

A. See the What's New page for details on Netscape for OS/2 and Hot Java for OS/2.

Q. I got Netscape for OS/2, but now some of my other Java stuff won't work. What happened?

A. The final (and beta 2 release) of Netscape installs the 1.0.2 Java runtime, and may add a second CLASSPATH statement to your CONFIG.SYS if you already have Java installed. You probably need to merge the two statements together, putting anything specific to your system after the new CLASSPATH. If you do not have the new Java Developers Kit installed, make sure any references to the old kit come after the Netscape stuff.

Q. Some applets still crash Netscape. What can I do?

A. Try disabling the just-in-time (JIT) compiler. Go to Options, Security Preferences, and check Disable Java Compiler. This choice seems to be checked on installation, disabling the JIT.

Q. I don't have "Merlin." Will I have Java support in Netscape for OS/2 under Warp version 3?

A. I haven't used this combination myself. But I'm assured it does work.

Q. Do you have versions of Java for download on the Three Cat Software site?

A. No, and we won't. The server running these pages is fairly easy to overload. Besides, I really would suggest using the official IBM source if possible. There are FTP mirror sites in the U.S., see the how to get it pages.

Q. What comes with the JDK for OS/2?

A. Included are the java interpreter, compiler, and an applet viewer (which is used to test applets that would normally be viewed by a Web browser), and all of the support files and classes needed to develop Java applets. NOT included is a Web browser (see how to get it for links to Netscape for OS/2). Hot Java, the browser written in Java, has just been released by IBM in a "technology demo" level. It is available from the developer area listed in the last link.

Q. How far along is the code?

A. The latest release of the JDK is version 1.1 of Java. This is not compatible with the current version of Netscape for OS/2, however.

Q. What happened to the bug information that used to be in this FAQ?

A. A lot of it is now outdated. The best source on bugs in the OS/2 port that I have seen is this portion of the Corrigan Computers FAQ. IBM, unfortunately, does not seem to have its own posted bug list. Also see Sun's bug list for version 1.0.2.

Q. I wrote a Java application with a main() method and a GUI, but I can't get it to run. Why?

A. With versions of the JDK prior to November 13, applications that use the AWT, as opposed to command-line aps, must be run with javapm.exe. That is the version of the Java interpreter for OS/2 needed to run applications that use the OS/2 Presentation Manager. Java applications, as opposed to applets, contain a main() method; such applications can be invoked by giving their class as an argument to javapm in the same way command-line apps are invoked with java and the class name. This does not apply to applets, for which you need the applet viewer supplied (and an HTML file to call the applet).

The November 13 JDK (version 1.0.2) eliminates the need to use javapm.

Q. How do I capture debugging messages from an application started with javapm?

A. With the July 2 and later versions of the JDK, start the application with the new -cons option:

            javapm -cons MyClass

This will start up a little console that will display both the standard output and standard error streams.

Another option that still works: You can redirect the standard out and standard error streams with the following command:

            javapm myap > output.txt 2> error.txt

Thanks to Phil Russell for pointing this out. (Note: this procedure also works for standard output for any PM app, not just Java ones.

Q. How about debugging messages from my applet, run under the applet viewer?

A. Standard output from the applet viewer's applets goes to a file; in recent versions of the JDK you can specify this file's location with the statement:

    SET JAVA_WEBLOGS=C:\JAVAOS2

adjusting the directory as needed.

But the newest (July 2) version of the JDK also allows you to use the same `-cons` option as with javapm.

Q. When I try setting the file for weblogs, the applet viewer won't start, instead saying it is unable to create the directory. What went wrong?

A. Check to make sure there is no trailing slash on the statement. The applet viewer does not like this slash and will refuse to create or use the directory.

Q. Is anyone else porting Java to OS/2?

A. A number of people on the OS/2 Java Porting mailing list have made progress on parts of the code. Some of their work has been posted to the FTP site. The mailing list archives will give you some idea of who is working on what. However, the work by IBM seems to have generally quieted other porting efforts (although I can't speak for everyone involved).

Q. Why is this FAQ so sketchy?

A. So tell me what's missing! I am always looking for more information (and impressions) on Java running on OS/2. Please email me markj@3cat.com with any information you'd like to see in the FAQ.

Q. Are there any other sources of information?

A. Yes. Please see the resources page.

Last revised May 9, 1997 by Mark H. James, Three Cat Software.

Back to the OS/2 Java Home Page.
Three Cat Software home page