Fixes to boot on Windows using SunJDK6 rt.jar jk_new_structure
authorvranyj1
Thu, 18 Aug 2011 11:29:01 +0000
branchjk_new_structure
changeset 919 11237e0d58e5
parent 918 73bd57f8d3b0
child 920 e6e8a96b217c
Fixes to boot on Windows using SunJDK6 rt.jar
src/JavaMethod.st
src/JavaRelease.st
src/JavaVM.st
src/libjava.rc
--- a/src/JavaMethod.st	Wed Aug 17 08:57:44 2011 +0000
+++ b/src/JavaMethod.st	Thu Aug 18 11:29:01 2011 +0000
@@ -825,6 +825,13 @@
     "Modified: / 8.1.1998 / 19:09:31 / cg"
 ! !
 
+!JavaMethod methodsFor:'* As yet uncategorized *'!
+
+sends:symbol1 or:symbol2
+
+    ^false
+! !
+
 !JavaMethod methodsFor:'accessing'!
 
 accessFlags
--- a/src/JavaRelease.st	Wed Aug 17 08:57:44 2011 +0000
+++ b/src/JavaRelease.st	Thu Aug 18 11:29:01 2011 +0000
@@ -334,8 +334,13 @@
     | h |
 
     h := (OperatingSystem getEnvironment:'JAVA_HOME').
-    h ifNotNil:
-        [^javaHome := h  asFilename].
+    h notNil ifTrue:[
+        javaHome := h  asFilename.
+        (javaHome / 'jre') exists ifTrue:[
+            javaHome := javaHome / 'jre'.
+        ].
+        ^javaHome
+    ].
 
     self javaHomes do:
         [:home| | homeAsFilename |
@@ -361,7 +366,7 @@
     src_zip exists ifTrue:[sourcePath add: src_zip asString].
 
     "
-        JavaRelease openJDK6 sourcePath      
+        JavaRelease openJDK6 searchForSourcePath; sourcePath      
     "
 
     "Created: / 27-10-2010 / 21:15:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
--- a/src/JavaVM.st	Wed Aug 17 08:57:44 2011 +0000
+++ b/src/JavaVM.st	Thu Aug 18 11:29:01 2011 +0000
@@ -2304,6 +2304,10 @@
             add: Java release javaHome asFilename / 'jre' / 'lib' / 'i386' ;
             add: Java release javaHome asFilename / 'jre' / 'bin' ;
             yourself.
+    OperatingSystem isMSWINDOWSlike ifTrue:[
+        dirs
+            add: Java release javaHome asFilename / 'bin'.
+    ].
 
     ^String streamContents:
         [:path|
@@ -2330,6 +2334,11 @@
             add: Java release javaHome asFilename / 'jre' / 'lib' / 'amd64'  ;
             add: Java release javaHome asFilename / 'jre' / 'lib' / 'i386' ;
             yourself.
+    OperatingSystem isMSWINDOWSlike ifTrue:[
+        dirs
+            add: Java release javaHome asFilename / 'bin'.
+    ].
+
 
     ^String streamContents:
         [:path|
@@ -3869,6 +3878,17 @@
     "Created: / 27.1.1998 / 18:16:29 / cg"
 !
 
+_java_io_FileDescriptor_set: nativeContext
+
+    <javanative: 'java/io/FileDescriptor' name: 'set(I)J'>
+
+    "SunJDK Speciofic method, we don't need handles, so return
+     FD instead"
+
+    ^nativeContext argAt:1
+
+!
+
 _java_io_FileDescriptor_sync: nativeContext
 
     <javanative: 'java/io/FileDescriptor' name: 'sync'>
@@ -4539,6 +4559,35 @@
     ^0
 
     "Modified: / 10-08-2011 / 13:40:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+_java_io_Win32FileSystem_initIDs: nativeContext
+
+    <javanative: 'java/io/Win32FileSystem' name: 'initIDs()V'>
+
+    "Intentionally left blank"
+!
+
+_java_io_WinNTFileSystem_canonicalize0: aJavaContext
+
+    <javanative: 'java/io/WinNTFileSystem' name: 'canonicalize0(Ljava/lang/String;)Ljava/lang/String;'>
+
+    
+    |  path |
+
+    path := Java as_ST_String: (aJavaContext argAt: 1).
+    ^(Java as_String: path asFilename asAbsoluteFilename pathName)
+
+    "Created: / 01-04-2011 / 23:00:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+_java_io_WinNTFileSystem_getBooleanAttributes: aJavaContext
+
+    <javanative: 'java/io/WinNTFileSystem' name: 'getBooleanAttributes(Ljava/io/File;)I'>
+
+    ^ self _java_io_UnixFileSystem_getBooleanAttributes0:aJavaContext
+
+    "Created: / 01-04-2011 / 18:10:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaVM class methodsFor:'native - java.lang'!
@@ -13882,23 +13931,6 @@
     "Modified: / 10.11.1998 / 21:34:18 / cg"
 !
 
-_WinNTFileSystem_canonicalize0:aJavaContext
-
-    |  path |
-
-    path := Java as_ST_String: (aJavaContext argAt: 1).
-    ^(Java as_String: path asFilename asAbsoluteFilename pathName)
-
-    "Created: / 01-04-2011 / 23:00:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-_WinNTFileSystem_getBooleanAttributes:aJavaContext
-
-    ^ self _UnixFileSystem_getBooleanAttributes0:aJavaContext
-
-    "Created: / 01-04-2011 / 18:10:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 _X11FontMetrics_getMFCharSegmentWidth:nativeContext
     "get multi-font string-segment width.
      Not yet supported - use standard strings width"
@@ -14005,18 +14037,15 @@
     ^ self _WGraphics_pSetForeground:nativeContext
 ! !
 
-!JavaVM class methodsFor:'native - old-style (converted)'!
-
-_Component_initIDs:nativeContext
-    "/ introduced with jdk1.2 ... (sigh)
-
-    "Created: / 27.1.1998 / 19:53:29 / cg"
-!
-
-_Toolkit_initIDs:nativeContext
-    "/ introduced with jdk1.2 ... (sigh)
-
-    "Created: / 27.1.1998 / 19:53:50 / cg"
+!JavaVM class methodsFor:'native - sun.io'!
+
+_sun_io_Win32ErrorMode_setErrorMode: nativeContext
+
+    <javanative: 'sun/io/Win32ErrorMode' name: 'setErrorMode(J)J'>
+
+    "FIXME: Ignored for now"
+
+    ^0
 ! !
 
 !JavaVM class methodsFor:'native - sun.management'!
@@ -14037,8 +14066,15 @@
         | input signame |
 
     input := Java as_ST_String: (aJavaContext argAt: 1).
-    signame := 'SIG', (input asUppercase).
-    ^ UnixOperatingSystem signalNamed: signame asSymbol.
+    OperatingSystem isUNIXlike ifTrue:[
+        signame := 'SIG', (input asUppercase).
+        ^UnixOperatingSystem signalNamed: signame asSymbol.
+    ].
+    OperatingSystem isMSWINDOWSlike ifTrue:[
+        signame := 'sig', (input asUppercase).
+        ^Win32OperatingSystem perform: signame asSymbol.
+    ].
+    self error: 'Unsupported OS'
 
     "Created: / 11-12-2010 / 15:22:07 / Jan Kurs <kurs.jan@post.cz>"
 !
--- a/src/libjava.rc	Wed Aug 17 08:57:44 2011 +0000
+++ b/src/libjava.rc	Thu Aug 18 11:29:01 2011 +0000
@@ -23,7 +23,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\nCopyright Jan Vrany, Jan Kurs and Marcel Hlopko\b          SWING Research Group, Czech Technical University In Prague\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.1.1\0"
-      VALUE "ProductDate", "Tue, 16 Aug 2011 11:52:36 GMT\0"
+      VALUE "ProductDate", "Thu, 18 Aug 2011 11:28:36 GMT\0"
     END
 
   END