Index: /trunk/LocalEnv.tpl.cmd
===================================================================
--- /trunk/LocalEnv.tpl.cmd	(revision 262)
+++ /trunk/LocalEnv.tpl.cmd	(revision 263)
@@ -83,2 +83,23 @@
 */
 
+/*
+ * Production definitions
+ * ----------------------------------------------------------------------------
+ *
+ * Not needed for playing around.
+ */
+
+/**
+ * JDK build number in format 'bNN'.
+ */
+/*
+call EnvSet 'BUILD_NUMBER', 'b00'
+*/
+
+/**
+ * Milestone name. Will appear in the version string after the verison number
+ * and before the build number.
+ */
+/*
+call EnvSet 'MILESTONE', 'internal'
+*/
Index: /trunk/doc/CHANGES.OS2
===================================================================
--- /trunk/doc/CHANGES.OS2	(revision 262)
+++ /trunk/doc/CHANGES.OS2	(revision 263)
@@ -4,4 +4,14 @@
 
 CHANGES
+
+
+1.6.0 Build 19 XXX (2011-xx-xx)
+
+  - Fixed: Accessing the network from Java applications would crash on some
+    machines (Odin bug).
+
+  - Fixed: spontaneous 100% CPU load in many Java applications (e.g. GenealogyJ
+    Jeti/2) when throwing NullPointerException as a result of accessing null
+    objects of some application classes (Odin bug).
 
 
Index: /trunk/doc/README.OS2
===================================================================
--- /trunk/doc/README.OS2	(revision 262)
+++ /trunk/doc/README.OS2	(revision 263)
@@ -1,7 +1,7 @@
-OpenJDK 6 Alpha for OS/2 and eCS
-
-Version 1.6.0 Build 19 Beta 2 (2011-01-12)
-
-This is a beta build intended for testing purposes.
+OpenJDK 6 for OS/2 and eCS
+
+Version 1.6.0 Build 19 RC (2011-xx-yy)
+
+This is a release candidate build intended for testing purposes.
 
 
@@ -206,4 +206,31 @@
 
 
+DLL NAMES
+
+  In the environment necessary to run OpenJDK on OS/2, the directory containing
+  JDK DLLs is listed in either LIBPATH or BEGINLIBPATH variable which makes
+  these DLLs available to Java processes as well as to any other process running
+  in the same environment. The original versions of OpenJDK use very generic DLL
+  names for some components (such as jpeg.dll, zip.dll) which may create name
+  conflicts with system DLLs and cause the Java DLLs to be loaded by programs
+  instead of the system ones leading to program malfunction.
+
+  To reduce the possibility of such conflicts, all Java DLLs that didn't have
+  a 'j' prefix in their names were renamed by prepending 'j' to the original
+  DLL name.
+
+  Besides adding the 'j' prefix, some DLLs were also renamed further to fit the
+  8 character length limit forced by the OS/2 kernel loader.
+
+
+  On OS/2, the directory containing JDK DLLs
+  In order to avoid conflicts...
+  the following dlls were renamed...
+
+  hprof.dll -> jhprof.dll in -agentlib: cmd line option
+  debug dlls as well
+
+
+
 CURRENT LIMITATIONS
 
Index: /trunk/env.cmd
===================================================================
--- /trunk/env.cmd	(revision 262)
+++ /trunk/env.cmd	(revision 263)
@@ -167,4 +167,11 @@
 if (fProductRelease) then do
     call EnvSet 'ALT_OUTPUTDIR', UnixSlashes(ScriptDir'\openjdk\build-product-release')
+    if (EnvGet('MILESTONE') == '') then do
+        call EnvSet 'MILESTONE', 'fcs' /* avoid appearing milestone in version string */
+    end
+    if (EnvGet('BUILD_NUMBER') == '') then do
+        say 'ERROR: BUILD_NUMBER must be set in -R mode!'
+        exit 1
+    end
 end
 
Index: /trunk/openjdk/hotspot/src/os/windows/vm/hpi_windows.cpp
===================================================================
--- /trunk/openjdk/hotspot/src/os/windows/vm/hpi_windows.cpp	(revision 262)
+++ /trunk/openjdk/hotspot/src/os/windows/vm/hpi_windows.cpp	(revision 263)
@@ -26,4 +26,10 @@
 # include "incls/_hpi_windows.cpp.incl"
 
+#ifdef __WIN32OS2__    
+# define HPI_LIBNAME "jhpi"
+#else
+# define HPI_LIBNAME "hpi"
+#endif
+
 typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *);
 
@@ -40,10 +46,11 @@
 
 #ifdef PRODUCT
-    const char *hpi_lib = "\\hpi.dll";
+    const char *hpi_lib = "\\" HPI_LIBNAME ".dll";
 #else
     char *ptr = strrchr(lib_name, '\\');
     //  On Win98 GetModuleFileName() returns the path in the upper case.
     assert(_strnicmp(ptr, "\\jvm",4) == 0, "invalid library name");
-    const char *hpi_lib = (_strnicmp(ptr, "\\jvm_g",6) == 0) ? "\\hpi_g.dll" : "\\hpi.dll";
+    const char *hpi_lib = (_strnicmp(ptr, "\\jvm_g",6) == 0) ?
+        "\\" HPI_LIBNAME "_g.dll" : "\\" HPI_LIBNAME ".dll";
 #endif
 
Index: /trunk/openjdk/hotspot/src/share/vm/classfile/classLoader.cpp
===================================================================
--- /trunk/openjdk/hotspot/src/share/vm/classfile/classLoader.cpp	(revision 262)
+++ /trunk/openjdk/hotspot/src/share/vm/classfile/classLoader.cpp	(revision 263)
@@ -560,5 +560,9 @@
   char path[JVM_MAXPATHLEN];
   char ebuf[1024];
+#ifdef __WIN32OS2__  
+  hpi::dll_build_name(path, sizeof(path), Arguments::get_dll_dir(), "jzip");
+#else  
   hpi::dll_build_name(path, sizeof(path), Arguments::get_dll_dir(), "zip");
+#endif
   void* handle = hpi::dll_load(path, ebuf, sizeof ebuf);
   if (handle == NULL) {
Index: /trunk/openjdk/hotspot/src/share/vm/runtime/arguments.cpp
===================================================================
--- /trunk/openjdk/hotspot/src/share/vm/runtime/arguments.cpp	(revision 262)
+++ /trunk/openjdk/hotspot/src/share/vm/runtime/arguments.cpp	(revision 263)
@@ -1888,5 +1888,11 @@
         }
 #ifdef JVMTI_KERNEL
-        if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
+        if (
+#ifdef __WIN32OS2__
+            (strcmp(name, "jhprof") == 0) ||
+#else
+            (strcmp(name, "hprof") == 0) ||
+#endif
+            (strcmp(name, "jdwp") == 0)) {
           warning("profiling and debugging agents are not supported with Kernel VM");
         } else
@@ -1908,5 +1914,11 @@
         }
 #ifdef JVMTI_KERNEL
-        if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
+        if (
+#ifdef __WIN32OS2__
+            (strcmp(name, "jhprof") == 0) ||
+#else
+            (strcmp(name, "hprof") == 0) ||
+#endif
+            (strcmp(name, "jdwp") == 0)) {
           warning("profiling and debugging agents are not supported with Kernel VM");
         } else
Index: /trunk/openjdk/hotspot/src/share/vm/runtime/os.cpp
===================================================================
--- /trunk/openjdk/hotspot/src/share/vm/runtime/os.cpp	(revision 262)
+++ /trunk/openjdk/hotspot/src/share/vm/runtime/os.cpp	(revision 263)
@@ -339,5 +339,9 @@
     // always able to find it when the loading executable is outside the JDK.
     // In order to keep working with 1.2 we ignore any loading errors.
+#if __WIN32OS2__    
+    dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "jverify");
+#else    
     dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "verify");
+#endif    
     dll_load(buffer, ebuf, sizeof(ebuf));
 
Index: /trunk/openjdk/jdk/make/com/sun/java/pack/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/com/sun/java/pack/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/com/sun/java/pack/Makefile	(revision 263)
@@ -33,4 +33,9 @@
 PRODUCT = sun
 PGRM = unpack200
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = junpack
+endif
+
 include $(BUILDDIR)/common/Defs.gmk
 
Index: /trunk/openjdk/jdk/make/java/hpi/windows/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/hpi/windows/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/hpi/windows/Makefile	(revision 263)
@@ -33,4 +33,8 @@
 LIB_LOCATION = $(BINDIR)
 
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jhpi
+endif
+
 include $(BUILDDIR)/common/Defs.gmk
 
@@ -66,5 +70,5 @@
 DEF_FILE = $(OBJDIR)/$(LIBRARY).def
 $(DEF_FILE): $(MAKEFILE_LIST)
-	@$(ECHO) "LIBRARY $(LIBRARY) INITINSTANCE TERMINSTANCE" > $@
+	@$(ECHO) "LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE" > $@
 	@$(ECHO) 'EXPORTS \n \
   DLL_Initialize = "_DLL_Initialize@8" \n \
Index: /trunk/openjdk/jdk/make/java/instrument/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/instrument/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/instrument/Makefile	(revision 263)
@@ -32,5 +32,7 @@
 PRODUCT = sun
 
-LIBRARY_SHORT = instrmnt
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jinstr
+endif
 
 # Configure the CFLAGS for this library.  Use static binding so that there
@@ -126,5 +128,5 @@
 DEF_FILE = $(OBJDIR)/$(LIBRARY).def
 $(DEF_FILE): $(MAKEFILE_LIST)
-	@$(ECHO) "LIBRARY $(LIBRARY) INITINSTANCE TERMINSTANCE" > $@
+	@$(ECHO) "LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE" > $@
 	@$(ECHO) 'EXPORTS \n \
   Agent_OnAttach = "_Agent_OnAttach@12" \n \
Index: /trunk/openjdk/jdk/make/java/java/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/java/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/java/Makefile	(revision 263)
@@ -55,5 +55,5 @@
 
 $(DEF_FILE): $(MAKEFILE_LIST)
-	@$(ECHO) "LIBRARY $(LIBRARY) INITINSTANCE TERMINSTANCE" > $@
+	@$(ECHO) "LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE" > $@
 	@$(ECHO) 'EXPORTS \n \
   Canonicalize = _Canonicalize \n \
Index: /trunk/openjdk/jdk/make/java/java_crw_demo/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/java_crw_demo/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/java_crw_demo/Makefile	(revision 263)
@@ -29,5 +29,7 @@
 LIBRARY_OUTPUT = java_crw_demo
 
+ifeq ($(PLATFORM), os2)
 LIBRARY_SHORT = javacrwd
+endif
 
 # Configure the CFLAGS for this library.
Index: /trunk/openjdk/jdk/make/java/java_hprof_demo/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/java_hprof_demo/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/java_hprof_demo/Makefile	(revision 263)
@@ -28,4 +28,8 @@
 PRODUCT = sun
 LIBRARY_OUTPUT = hprof_jvmti
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jhprof
+endif
 
 # Configure the CFLAGS for this library.
Index: /trunk/openjdk/jdk/make/java/jli/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/jli/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/jli/Makefile	(revision 263)
@@ -105,5 +105,5 @@
 DEF_FILE = $(OBJDIR)/$(LIBRARY).def
 $(DEF_FILE): $(MAKEFILE_LIST)
-	@$(ECHO) "LIBRARY $(LIBRARY) INITINSTANCE TERMINSTANCE" > $@
+	@$(ECHO) "LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE" > $@
 	@$(ECHO) 'EXPORTS \n \
   _JLI_ParseManifest \n \
Index: /trunk/openjdk/jdk/make/java/management/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/management/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/management/Makefile	(revision 263)
@@ -29,5 +29,7 @@
 PRODUCT = java
 
-LIBRARY_SHORT = mngemnt
+ifeq ($(PLATFORM), os2) 
+LIBRARY_SHORT = jmngmnt
+endif
 
 include $(BUILDDIR)/common/Defs.gmk
Index: /trunk/openjdk/jdk/make/java/net/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/net/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/net/Makefile	(revision 263)
@@ -28,4 +28,9 @@
 LIBRARY = net
 PRODUCT = sun
+
+ifeq ($(PLATFORM), os2) 
+LIBRARY_SHORT = jnet
+endif
+
 include $(BUILDDIR)/common/Defs.gmk
 
Index: /trunk/openjdk/jdk/make/java/nio/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/nio/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/nio/Makefile	(revision 263)
@@ -33,4 +33,9 @@
 PRODUCT = java
 OTHER_JAVACFLAGS += -Xmaxwarns 1000 -Xlint:serial -Werror
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jnio
+endif
+
 include $(BUILDDIR)/common/Defs.gmk
 
Index: /trunk/openjdk/jdk/make/java/npt/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/npt/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/npt/Makefile	(revision 263)
@@ -28,4 +28,8 @@
 PRODUCT = sun
 LIBRARY_OUTPUT = npt
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jnpt
+endif
 
 # Configure the CFLAGS for this library.
@@ -71,5 +75,5 @@
 DEF_FILE = $(OBJDIR)/$(LIBRARY).def
 $(DEF_FILE): $(MAKEFILE_LIST)
-	@$(ECHO) "LIBRARY $(LIBRARY) INITINSTANCE TERMINSTANCE" > $@
+	@$(ECHO) "LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE" > $@
 	@$(ECHO) 'EXPORTS \n \
   nptInitialize = "_nptInitialize@12" \n \
Index: /trunk/openjdk/jdk/make/java/verify/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/verify/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/verify/Makefile	(revision 263)
@@ -32,4 +32,8 @@
 LIBRARY = verify
 include $(BUILDDIR)/common/Defs.gmk
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jverify
+endif
 
 #
Index: /trunk/openjdk/jdk/make/java/zip/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/java/zip/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/java/zip/Makefile	(revision 263)
@@ -29,4 +29,9 @@
 LIBRARY = zip
 PRODUCT = sun
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jzip
+endif
+
 include $(BUILDDIR)/common/Defs.gmk
 
@@ -73,5 +78,5 @@
 DEF_FILE = $(OBJDIR)/$(LIBRARY).def
 $(DEF_FILE): $(MAKEFILE_LIST)
-	@$(ECHO) "LIBRARY $(LIBRARY) INITINSTANCE TERMINSTANCE" > $@
+	@$(ECHO) "LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE" > $@
 	@$(ECHO) 'EXPORTS \n \
   ZIP_CRC32 = _ZIP_CRC32 \n \
Index: /trunk/openjdk/jdk/make/jpda/transport/shmem/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/jpda/transport/shmem/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/jpda/transport/shmem/Makefile	(revision 263)
@@ -31,4 +31,8 @@
 LIBRARY  = dt_shmem
 PRODUCT = jbug
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jdtshmem
+endif
 
 # Mapfile only used on Solaris/Linux
@@ -79,5 +83,5 @@
 DEF_FILE = $(OBJDIR)/$(LIBRARY).def
 $(DEF_FILE): $(MAKEFILE_LIST)
-	@$(ECHO) "LIBRARY $(LIBRARY) INITINSTANCE TERMINSTANCE" > $@
+	@$(ECHO) "LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE" > $@
 	@$(ECHO) 'EXPORTS \n \
   jdwpTransport_OnLoad = "_jdwpTransport_OnLoad@16" \n \
Index: /trunk/openjdk/jdk/make/jpda/transport/socket/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/jpda/transport/socket/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/jpda/transport/socket/Makefile	(revision 263)
@@ -30,6 +30,9 @@
 BUILDDIR = ../../..
 LIBRARY = dt_socket
-LIBRARY_SHORT = dt_sock
 PRODUCT = jbug
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jdtsock
+endif
 
 # Mapfile only used on Solaris/Linux
@@ -94,5 +97,5 @@
 DEF_FILE = $(OBJDIR)/$(LIBRARY).def
 $(DEF_FILE): $(MAKEFILE_LIST)
-	@$(ECHO) "LIBRARY $(LIBRARY) INITINSTANCE TERMINSTANCE" > $@
+	@$(ECHO) "LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE" > $@
 	@$(ECHO) 'EXPORTS \n \
   jdwpTransport_OnLoad = "_jdwpTransport_OnLoad@16" \n \
Index: /trunk/openjdk/jdk/make/mkdemo/jvmti/hprof/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/mkdemo/jvmti/hprof/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/mkdemo/jvmti/hprof/Makefile	(revision 263)
@@ -29,4 +29,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
+ifeq ($(PLATFORM), os2)
+DEMONAME_SHORT = jhprof
+endif
+
 DEMO_ROOT       = $(SHARE_SRC)/demo/jvmti/$(DEMONAME)
 DEMO_TOPFILES   = ./README.txt
Index: /trunk/openjdk/jdk/make/sun/awt/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/sun/awt/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/sun/awt/Makefile	(revision 263)
@@ -28,4 +28,8 @@
 LIBRARY = awt
 PRODUCT = sun
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jawtos2
+endif
 
 #
Index: /trunk/openjdk/jdk/make/sun/cmm/lcms/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/sun/cmm/lcms/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/sun/cmm/lcms/Makefile	(revision 263)
@@ -28,4 +28,8 @@
 LIBRARY = lcms
 PRODUCT = sun
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jlcms
+endif
 
 include $(BUILDDIR)/common/Defs.gmk
Index: /trunk/openjdk/jdk/make/sun/font/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/sun/font/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/sun/font/Makefile	(revision 263)
@@ -33,5 +33,7 @@
 PRODUCT = sun
 
-LIBRARY_SHORT = fontmgr
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jfontmgr
+endif
 
 # Indicate we want the C++ compiler to do the linking.
Index: /trunk/openjdk/jdk/make/sun/image/generic/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/sun/image/generic/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/sun/image/generic/Makefile	(revision 263)
@@ -33,5 +33,7 @@
 PRODUCT = sun
 
-LIBRARY_SHORT = mlibimg
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jmlibimg
+endif
 
 include $(BUILDDIR)/common/Defs.gmk
@@ -58,5 +60,5 @@
 DEF_FILE = $(OBJDIR)/$(LIBRARY).def
 $(DEF_FILE): $(MAKEFILE_LIST)
-	@$(ECHO) "LIBRARY $(LIBRARY) INITINSTANCE TERMINSTANCE" > $@
+	@$(ECHO) "LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE" > $@
 	@$(ECHO) 'EXPORTS \n \
   j2d_mlib_ImageConvMxN = _j2d_mlib_ImageConvMxN \n \
Index: /trunk/openjdk/jdk/make/sun/jpeg/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/sun/jpeg/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/sun/jpeg/Makefile	(revision 263)
@@ -29,4 +29,8 @@
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
+
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jjpeg
+endif
 
 #
Index: /trunk/openjdk/jdk/make/sun/rmi/rmi/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/sun/rmi/rmi/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/sun/rmi/rmi/Makefile	(revision 263)
@@ -32,4 +32,9 @@
 PRODUCT = sun
 LIBRARY = rmi
+
+ifeq ($(PLATFORM), os2)
+LIBRARY = jrmi
+endif
+
 include $(BUILDDIR)/common/Defs.gmk
 
Index: /trunk/openjdk/jdk/make/sun/security/mscapi/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/sun/security/mscapi/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/sun/security/mscapi/Makefile	(revision 263)
@@ -94,5 +94,7 @@
 PRODUCT = sun
 
-LIBRARY_SHORT = smscapi
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jsmscapi
+endif
 
 #
Index: /trunk/openjdk/jdk/make/sun/splashscreen/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/sun/splashscreen/Makefile	(revision 262)
+++ /trunk/openjdk/jdk/make/sun/splashscreen/Makefile	(revision 263)
@@ -30,5 +30,7 @@
 include $(BUILDDIR)/common/Defs.gmk
 
-LIBRARY_SHORT = splshscr
+ifeq ($(PLATFORM), os2)
+LIBRARY_SHORT = jsplash
+endif
 
 #
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	(revision 263)
@@ -85,6 +85,10 @@
 
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("jpeg"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jjpeg"
+                                                            : "jpeg"));
         initReaderIDs(ImageInputStream.class,
                       JPEGQTable.class,
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java	(revision 263)
@@ -68,6 +68,10 @@
         }
         try {
+            boolean isOS2 = java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction("os.name")).
+                    startsWith("OS/2");
             java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("jpeg"));
+                new sun.security.action.LoadLibraryAction(isOS2 ? "jjpeg"
+                                                                : "jpeg"));
             // Stuff it all into one lib for first pass
             //java.security.AccessController.doPrivileged(
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	(revision 263)
@@ -177,6 +177,10 @@
 
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("jpeg"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jjpeg"
+                                                            : "jpeg"));
         initWriterIDs(ImageOutputStream.class,
                       JPEGQTable.class,
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java	(revision 263)
@@ -76,6 +76,10 @@
         }
         try {
+            boolean isOS2 = java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction("os.name")).
+                    startsWith("OS/2");
             java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("jpeg"));
+                new sun.security.action.LoadLibraryAction(isOS2 ? "jjpeg"
+                                                                : "jpeg"));
         } catch (Throwable e) { // Fail on any Throwable
             // if it can't be loaded, deregister and return
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java	(revision 263)
@@ -84,6 +84,10 @@
         // If loading from stand alone build uncomment this.
         // System.loadLibrary("unpack");
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("unpack"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "junpack"
+                                                            : "unpack"));
         initIDs();
     }
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java	(revision 263)
@@ -172,10 +172,6 @@
     }
 
-    private static final boolean isOS2 = AccessController
-        .doPrivileged(new PrivilegedAction<Boolean>() {
-            public Boolean run() {
-                return System.getProperty("os.name").startsWith("OS/2");
-            }
-        });
+    private static final boolean isOS2 = AccessController.doPrivileged(
+        new sun.security.action.GetPropertyAction("os.name")).startsWith("OS/2");
 
     protected static final String INFO_NAME = "Gervill";
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java	(revision 263)
@@ -776,5 +776,8 @@
                 continue;
             }
-            if ("dt_shmem".equals(connector.transport().name())) {
+            final String shmemLib =
+                System.getProperty("os.name").startsWith("OS/2") ? "jdtshmem"
+                                                                 : "dt_shmem";
+            if (shmemLib.equals(connector.transport().name())) {
                 return true;
             }
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/ProcessAttachingConnector.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/ProcessAttachingConnector.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/ProcessAttachingConnector.java	(revision 263)
@@ -123,9 +123,10 @@
 
         TransportService ts = null;
-        final String sockLib = System.getProperty("os.name").startsWith("OS/2") ? "dt_sock" : "dt_socket";
+        final String sockLib = System.getProperty("os.name").startsWith("OS/2") ? "jdtsock" : "dt_socket";
         if (lib.equals(sockLib)) {
             ts = new SocketTransportService();
         } else {
-            if (lib.equals("dt_shmem")) {
+            final String shmemLib = System.getProperty("os.name").startsWith("OS/2") ? "jdtshmem" : "dt_shmem";
+            if (lib.equals(shmemLib)) {
                 try {
                     Class c = Class.forName("com.sun.tools.jdi.SharedMemoryTransportService");
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/RawCommandLineLauncher.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/RawCommandLineLauncher.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/RawCommandLineLauncher.java	(revision 263)
@@ -58,4 +58,6 @@
             transport = new Transport() {
                 public String name() {
+                    if (System.getProperty("os.name").startsWith("OS/2"))
+                        return "jdtshmem";
                     return "dt_shmem";
                 }
@@ -72,5 +74,5 @@
                 public String name() {
                     if (System.getProperty("os.name").startsWith("OS/2"))
-                        return "dt_sock";
+                        return "jdtsock";
                     return "dt_socket";
                 }
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java	(revision 263)
@@ -70,5 +70,5 @@
             public String name() {
                 if (System.getProperty("os.name").startsWith("OS/2"))
-                    return "dt_sock";
+                    return "jdtsock";
                 return "dt_socket";     // for compatability reasons
             }
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java	(revision 263)
@@ -60,5 +60,5 @@
             public String name() {
                 if (System.getProperty("os.name").startsWith("OS/2"))
-                    return "dt_sock";
+                    return "jdtsock";
                 return "dt_socket";     // for compatability reasons
             }
Index: /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java	(revision 263)
@@ -69,4 +69,6 @@
             transport = new Transport() {
                 public String name() {
+                    if (System.getProperty("os.name").startsWith("OS/2"))
+                        return "jdtshmem";
                     return "dt_shmem";
                 }
@@ -83,5 +85,5 @@
                 public String name() {
                     if (System.getProperty("os.name").startsWith("OS/2"))
-                        return "dt_sock";
+                        return "jdtsock";
                     return "dt_socket";
                 }
Index: /trunk/openjdk/jdk/src/share/classes/java/awt/SplashScreen.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/awt/SplashScreen.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/awt/SplashScreen.java	(revision 263)
@@ -109,11 +109,10 @@
             // SplashScreen class is now a singleton
             if (!wasClosed && theInstance == null) {
-                if (System.getProperty("os.name").startsWith("OS/2")) {
-                    java.security.AccessController.doPrivileged(
-                        new sun.security.action.LoadLibraryAction("splshscr"));
-                } else {
-                    java.security.AccessController.doPrivileged(
-                        new sun.security.action.LoadLibraryAction("splashscreen"));
-                }
+                boolean isOS2 = java.security.AccessController.doPrivileged(
+                    new sun.security.action.GetPropertyAction("os.name")).
+                        startsWith("OS/2");
+                java.security.AccessController.doPrivileged(
+                    new sun.security.action.LoadLibraryAction(isOS2 ? "jsplash"
+                                                                    : "splashscreen"));
                 long ptr = _getInstance();
                 if (ptr != 0 && _isVisible(ptr)) {
Index: /trunk/openjdk/jdk/src/share/classes/java/awt/Toolkit.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/awt/Toolkit.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/awt/Toolkit.java	(revision 263)
@@ -1608,6 +1608,10 @@
     static void loadLibraries() {
         if (!loaded) {
+            boolean isOS2 = java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction("os.name")).
+                    startsWith("OS/2");
             java.security.AccessController.doPrivileged(
-                          new sun.security.action.LoadLibraryAction("awt"));
+                new sun.security.action.LoadLibraryAction(isOS2 ? "jawtos2"
+                                                                : "awt"));
             loaded = true;
         }
Index: /trunk/openjdk/jdk/src/share/classes/java/awt/event/NativeLibLoader.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/awt/event/NativeLibLoader.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/awt/event/NativeLibLoader.java	(revision 263)
@@ -54,6 +54,10 @@
      */
     static void loadLibraries() {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("awt"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jawtos2"
+                                                            : "awt"));
     }
 }
Index: /trunk/openjdk/jdk/src/share/classes/java/awt/image/ColorModel.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/awt/image/ColorModel.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/awt/image/ColorModel.java	(revision 263)
@@ -204,6 +204,10 @@
     static void loadLibraries() {
         if (!loaded) {
+            boolean isOS2 = java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction("os.name")).
+                    startsWith("OS/2");
             java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("awt"));
+                new sun.security.action.LoadLibraryAction(isOS2 ? "jawtos2"
+                                                                : "awt"));
             loaded = true;
         }
Index: /trunk/openjdk/jdk/src/share/classes/java/lang/System.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/lang/System.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/lang/System.java	(revision 263)
@@ -1098,5 +1098,5 @@
         // Load the zip library now in order to keep java.util.zip.ZipFile
         // from trying to use itself to load this library later.
-        loadLibrary("zip");
+        loadLibrary(getProperty("os.name").startsWith("OS/2") ? "jzip" : "zip");
 
         // Setup Java signal handlers for HUP, TERM, and INT (where available).
Index: /trunk/openjdk/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java	(revision 263)
@@ -58,6 +58,10 @@
      */
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("net"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jnet"
+                                                            : "net"));
     }
 
Index: /trunk/openjdk/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java	(revision 263)
@@ -74,6 +74,10 @@
      */
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("net"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jnet"
+                                                            : "net"));
     }
 
Index: /trunk/openjdk/jdk/src/share/classes/java/net/DatagramPacket.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/net/DatagramPacket.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/net/DatagramPacket.java	(revision 263)
@@ -47,6 +47,10 @@
      */
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("net"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jnet"
+                                                            : "net"));
         init();
     }
Index: /trunk/openjdk/jdk/src/share/classes/java/net/InetAddress.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/net/InetAddress.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/net/InetAddress.java	(revision 263)
@@ -232,5 +232,8 @@
         preferIPv6Address = java.security.AccessController.doPrivileged(
             new GetBooleanAction("java.net.preferIPv6Addresses")).booleanValue();
-        AccessController.doPrivileged(new LoadLibraryAction("net"));
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new GetPropertyAction("os.name")).startsWith("OS/2");
+        AccessController.doPrivileged(new LoadLibraryAction(isOS2 ? "jnet" 
+                                                                  : "net"));
         init();
     }
Index: /trunk/openjdk/jdk/src/share/classes/java/net/NetworkInterface.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/java/net/NetworkInterface.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/java/net/NetworkInterface.java	(revision 263)
@@ -53,5 +53,8 @@
 
     static {
-        AccessController.doPrivileged(new LoadLibraryAction("net"));
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new GetPropertyAction("os.name")).startsWith("OS/2");
+        AccessController.doPrivileged(new LoadLibraryAction(isOS2 ? "jnet" 
+                                                                  : "net"));
         init();
     }
Index: /trunk/openjdk/jdk/src/share/classes/sun/awt/NativeLibLoader.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/awt/NativeLibLoader.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/awt/NativeLibLoader.java	(revision 263)
@@ -54,6 +54,10 @@
      */
     static void loadLibraries() {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("awt"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jawtos2"
+                                                            : "awt"));
     }
 }
Index: /trunk/openjdk/jdk/src/share/classes/sun/awt/image/ImagingLib.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/awt/image/ImagingLib.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/awt/image/ImagingLib.java	(revision 263)
@@ -98,5 +98,5 @@
                         try {
                             if (System.getProperty("os.name").startsWith("OS/2")) {
-                                System.loadLibrary("mlibimg");
+                                System.loadLibrary("jmlibimg");
                             } else {
                                 System.loadLibrary("mlib_image");
Index: /trunk/openjdk/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java	(revision 263)
@@ -54,6 +54,10 @@
 
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("jpeg"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jjpeg"
+                                                            : "jpeg"));
         initIDs(InputStreamClass);
         RGBcolormodel = new DirectColorModel(24, 0xff0000, 0xff00, 0xff);
Index: /trunk/openjdk/jdk/src/share/classes/sun/awt/image/NativeLibLoader.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/awt/image/NativeLibLoader.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/awt/image/NativeLibLoader.java	(revision 263)
@@ -54,6 +54,10 @@
      */
     static void loadLibraries() {
-        java.security.AccessController.doPrivileged
-                (new sun.security.action.LoadLibraryAction("awt"));
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
+        java.security.AccessController.doPrivileged(
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jawtos2"
+                                                            : "awt"));
     }
 }
Index: /trunk/openjdk/jdk/src/share/classes/sun/font/FontManagerNativeLibrary.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/font/FontManagerNativeLibrary.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/font/FontManagerNativeLibrary.java	(revision 263)
@@ -34,5 +34,9 @@
             public Object run() {
                /* REMIND do we really have to load awt here? */
-               System.loadLibrary("awt");
+               if (System.getProperty("os.name").startsWith("OS/2")) {
+                   System.loadLibrary("jawtos2");
+               } else {
+                   System.loadLibrary("awt");
+               }
                if (SunGraphicsEnvironment.isOpenJDK() &&
                    System.getProperty("os.name").startsWith("Windows")) {
@@ -60,5 +64,5 @@
                }
                if (System.getProperty("os.name").startsWith("OS/2")) {
-                   System.loadLibrary("fontmgr");
+                   System.loadLibrary("jfontmgr");
                } else {
                    System.loadLibrary("fontmanager");
Index: /trunk/openjdk/jdk/src/share/classes/sun/instrument/InstrumentationImpl.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/instrument/InstrumentationImpl.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/instrument/InstrumentationImpl.java	(revision 263)
@@ -273,5 +273,5 @@
     static {
         if (System.getProperty("os.name").startsWith("OS/2")) {
-            System.loadLibrary("instrmnt");
+            System.loadLibrary("jinstr");
         } else {
             System.loadLibrary("instrument");
Index: /trunk/openjdk/jdk/src/share/classes/sun/java2d/Disposer.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/java2d/Disposer.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/java2d/Disposer.java	(revision 263)
@@ -56,6 +56,10 @@
 
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("awt"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jawtos2"
+                                                            : "awt"));
         initIDs();
         String type = (String) java.security.AccessController.doPrivileged(
Index: /trunk/openjdk/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java	(revision 263)
@@ -92,6 +92,11 @@
                      * disposer frameworks
                      */
-                    System.loadLibrary("awt");
-                    System.loadLibrary("lcms");
+                    if (System.getProperty("os.name").startsWith("OS/2")) {
+                        System.loadLibrary("jawtos2");
+                        System.loadLibrary("jlcms");
+                    } else {
+                        System.loadLibrary("awt");
+                        System.loadLibrary("lcms");
+                    }
                     return null;
                 }
Index: /trunk/openjdk/jdk/src/share/classes/sun/management/ManagementFactory.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/management/ManagementFactory.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/management/ManagementFactory.java	(revision 263)
@@ -49,4 +49,5 @@
 import java.security.PrivilegedExceptionAction;
 import sun.security.action.LoadLibraryAction;
+import sun.security.action.GetPropertyAction;
 
 import java.util.ArrayList;
@@ -483,9 +484,8 @@
 
     static {
-        if (System.getProperty("os.name").startsWith("OS/2")) {
-            AccessController.doPrivileged(new LoadLibraryAction("mngemnt"));
-        } else {
-            AccessController.doPrivileged(new LoadLibraryAction("management"));
-        }
+        boolean isOS2 = AccessController.doPrivileged(
+            new GetPropertyAction("os.name")).startsWith("OS/2");
+        AccessController.doPrivileged(new LoadLibraryAction(isOS2 ? "jmngmnt"
+                                                                  : "management"));
         jvm = new VMManagementImpl();
     }
Index: /trunk/openjdk/jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java	(revision 263)
@@ -89,6 +89,10 @@
                 }});
         if (b != null && b.booleanValue()) {
+            boolean isOS2 = java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction("os.name")).
+                    startsWith("OS/2");
             java.security.AccessController.doPrivileged(
-                      new sun.security.action.LoadLibraryAction("net"));
+                new sun.security.action.LoadLibraryAction(isOS2 ? "jnet"
+                                                                : "net"));
             hasSystemProxies = init();
         }
Index: /trunk/openjdk/jdk/src/share/classes/sun/nio/ch/Util.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/nio/ch/Util.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/nio/ch/Util.java	(revision 263)
@@ -354,8 +354,13 @@
                 return;
             loaded = true;
-            java.security.AccessController
-                .doPrivileged(new sun.security.action.LoadLibraryAction("net"));
-            java.security.AccessController
-                .doPrivileged(new sun.security.action.LoadLibraryAction("nio"));
+            boolean isOS2 = java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction("os.name")).
+                    startsWith("OS/2");
+            java.security.AccessController.doPrivileged(
+                new sun.security.action.LoadLibraryAction(isOS2 ? "jnet"
+                                                                : "net"));
+            java.security.AccessController.doPrivileged(
+                new sun.security.action.LoadLibraryAction(isOS2 ? "jnio"
+                                                                : "nio"));
             // IOUtil must be initialized; Its native methods are called from
             // other places in native nio code so they must be set up.
Index: /trunk/openjdk/jdk/src/share/classes/sun/rmi/server/MarshalInputStream.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/rmi/server/MarshalInputStream.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/rmi/server/MarshalInputStream.java	(revision 263)
@@ -112,6 +112,10 @@
      */
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("rmi"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jrmi"
+                                                            : "rmi"));
     }
 
Index: /trunk/openjdk/jdk/src/share/classes/sun/tools/attach/HotSpotVirtualMachine.java
===================================================================
--- /trunk/openjdk/jdk/src/share/classes/sun/tools/attach/HotSpotVirtualMachine.java	(revision 262)
+++ /trunk/openjdk/jdk/src/share/classes/sun/tools/attach/HotSpotVirtualMachine.java	(revision 263)
@@ -102,5 +102,5 @@
         try {
             if (System.getProperty("os.name").startsWith("OS/2")) {
-                loadAgentLibrary("instrmnt", args);
+                loadAgentLibrary("jinstr", args);
             } else {
                 loadAgentLibrary("instrument", args);
Index: /trunk/openjdk/jdk/src/share/demo/jvmti/hprof/hprof.h
===================================================================
--- /trunk/openjdk/jdk/src/share/demo/jvmti/hprof/hprof.h	(revision 262)
+++ /trunk/openjdk/jdk/src/share/demo/jvmti/hprof/hprof.h	(revision 263)
@@ -78,5 +78,10 @@
 /* How the options get to OnLoad: */
 
+#ifdef __WIN32OS2__
+#define AGENTNAME               "jhprof"
+#else
 #define AGENTNAME               "hprof"
+#endif
+
 #define XRUN                    "-Xrun" AGENTNAME
 #define AGENTLIB                "-agentlib:" AGENTNAME
Index: /trunk/openjdk/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java
===================================================================
--- /trunk/openjdk/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	(revision 262)
+++ /trunk/openjdk/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	(revision 263)
@@ -244,6 +244,10 @@
 
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("net"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jnet"
+                                                            : "net"));
     }
 
Index: /trunk/openjdk/jdk/src/solaris/classes/sun/print/CUPSPrinter.java
===================================================================
--- /trunk/openjdk/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	(revision 262)
+++ /trunk/openjdk/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	(revision 263)
@@ -77,6 +77,10 @@
     static {
         // load awt library to access native code
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("awt"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jawtos2"
+                                                            : "awt"));
         libFound = initIDs();
         if (libFound) {
Index: /trunk/openjdk/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryAttachingConnector.java
===================================================================
--- /trunk/openjdk/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryAttachingConnector.java	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryAttachingConnector.java	(revision 263)
@@ -51,4 +51,6 @@
         transport = new Transport() {
             public String name() {
+                if (System.getProperty("os.name").startsWith("OS/2"))
+                    return "jdtshmem";
                 return "dt_shmem";              // for compatability reasons
             }
Index: /trunk/openjdk/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryListeningConnector.java
===================================================================
--- /trunk/openjdk/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryListeningConnector.java	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryListeningConnector.java	(revision 263)
@@ -50,4 +50,6 @@
         transport = new Transport() {
             public String name() {
+                if (System.getProperty("os.name").startsWith("OS/2"))
+                    return "jdtshmem";
                 return "dt_shmem";              // compatability
             }
Index: /trunk/openjdk/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryTransportService.java
===================================================================
--- /trunk/openjdk/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryTransportService.java	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryTransportService.java	(revision 263)
@@ -67,5 +67,8 @@
 
     SharedMemoryTransportService() {
-        System.loadLibrary("dt_shmem");
+        final String shmemLib =
+            System.getProperty("os.name").startsWith("OS/2") ? "jdtshmem"
+                                                             : "dt_shmem";
+        System.loadLibrary(shmemLib);
         initialize();
     }
Index: /trunk/openjdk/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
===================================================================
--- /trunk/openjdk/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	(revision 263)
@@ -34,4 +34,5 @@
 import java.util.*;
 import sun.security.action.LoadLibraryAction;
+import sun.security.action.GetPropertyAction;
 
 import static sun.awt.shell.Win32ShellFolder2.*;
@@ -52,5 +53,6 @@
     static {
         // Load library here
-        AccessController.doPrivileged(new LoadLibraryAction("awt"));
+        boolean isOS2 = AccessController.doPrivileged(new GetPropertyAction("os.name")).startsWith("OS/2");
+        AccessController.doPrivileged(new LoadLibraryAction(isOS2 ? "jawtos2" : "awt"));
     }
 
Index: /trunk/openjdk/jdk/src/windows/classes/sun/awt/windows/WToolkit.java
===================================================================
--- /trunk/openjdk/jdk/src/windows/classes/sun/awt/windows/WToolkit.java	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/classes/sun/awt/windows/WToolkit.java	(revision 263)
@@ -87,6 +87,10 @@
     public static void loadLibraries() {
         if (!loaded) {
+            boolean isOS2 = java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction("os.name")).
+                    startsWith("OS/2");
             java.security.AccessController.doPrivileged(
-                          new sun.security.action.LoadLibraryAction("awt"));
+                new sun.security.action.LoadLibraryAction(isOS2 ? "jawtos2"
+                                                                : "awt"));
             loaded = true;
         }
Index: /trunk/openjdk/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java
===================================================================
--- /trunk/openjdk/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java	(revision 263)
@@ -160,6 +160,10 @@
 
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("net"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jnet"
+                                                            : "net"));
         init0();
 
Index: /trunk/openjdk/jdk/src/windows/classes/sun/print/Win32PrintServiceLookup.java
===================================================================
--- /trunk/openjdk/jdk/src/windows/classes/sun/print/Win32PrintServiceLookup.java	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/classes/sun/print/Win32PrintServiceLookup.java	(revision 263)
@@ -56,6 +56,10 @@
 
     static {
+        boolean isOS2 = java.security.AccessController.doPrivileged(
+            new sun.security.action.GetPropertyAction("os.name")).
+                startsWith("OS/2");
         java.security.AccessController.doPrivileged(
-                    new sun.security.action.LoadLibraryAction("awt"));
+            new sun.security.action.LoadLibraryAction(isOS2 ? "jawtos2"
+                                                            : "awt"));
     }
 
Index: /trunk/openjdk/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java
===================================================================
--- /trunk/openjdk/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java	(revision 263)
@@ -52,5 +52,5 @@
             public Object run() {
                 if (System.getProperty("os.name").startsWith("OS/2")) {
-                    System.loadLibrary("smscapi");
+                    System.loadLibrary("jsmscapi");
                 } else {
                     System.loadLibrary("sunmscapi");
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp	(revision 263)
@@ -77,5 +77,9 @@
     // an infinite loop if some W call were made inside AwtToolkit class
     // initialization.
+#ifdef __WIN32OS2__    
+    HMODULE hmodAWT = GetModuleHandleA("jawtos2");
+#else
     HMODULE hmodAWT = GetModuleHandleA("awt");
+#endif
     LPSTR abspath = static_cast<LPSTR>(safe_Malloc(MAX_PATH));
     if (abspath != NULL) {
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Mlib.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Mlib.cpp	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Mlib.cpp	(revision 263)
@@ -50,5 +50,5 @@
          */
 #ifdef __WIN32OS2__         
-        hDLL = ::LoadLibrary(TEXT("mlibimg.dll"));
+        hDLL = ::LoadLibrary(TEXT("jmlibimg.dll"));
 #else
         hDLL = ::LoadLibrary(TEXT("mlib_image.dll"));
Index: /trunk/openjdk/jdk/src/windows/npt/npt_md.h
===================================================================
--- /trunk/openjdk/jdk/src/windows/npt/npt_md.h	(revision 262)
+++ /trunk/openjdk/jdk/src/windows/npt/npt_md.h	(revision 263)
@@ -34,5 +34,9 @@
 #include <errno.h>
 
+#ifdef __WIN32OS2__
+#define NPT_LIBNAME "jnpt.dll"
+#else
 #define NPT_LIBNAME "npt.dll"
+#endif
 
 #define NPT_INITIALIZE(pnpt,version,options)                            \
