Package: bsh / 2.0b4-18

02_GNUvms_workaround.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Description: Insert a work around for GNU JVMs to use an AWT based GUI instead
 of swing.
Author: Wolfgang Baer <WBaer@gmx.de>

--- bsh~/src/bsh/Console.java	2003-08-29 17:11:14.000000000 +0200
+++ bsh/src/bsh/Console.java	2005-02-22 23:20:35.422962248 +0100
@@ -35,6 +35,7 @@
 package bsh;
 
 import bsh.util.*;
+import java.util.Properties;
 
 /**
 	Console startup class.
@@ -47,18 +48,25 @@
 			System.out.println("Can't find the BeanShell utilities...");
 
 		if ( Capabilities.haveSwing() ) 
-		{
-			bsh.util.Util.startSplashScreen();
-			try {
-				new Interpreter().eval("desktop()");
-			} catch ( EvalError e ) {
-				System.err.println("Couldn't start desktop: "+e);
+		{	
+
+			// Test if gnu classpath vm
+			Properties props = System.getProperties();
+			if(props.getProperty("gnu.classpath.version") == null) { // ok sun vm
+			
+				bsh.util.Util.startSplashScreen();
+				try {
+					new Interpreter().eval("desktop()");
+				} catch ( EvalError e ) {
+					System.err.println("Couldn't start desktop: "+e);
+				}
+			}
+			else { // gnu classpath derived vm
+				AWTConsole.main( args );
 			}
 		} else {
 			System.err.println(
-				"Can't find javax.swing package: "
-			+" An AWT based Console is available but not built by default.");
-			//AWTConsole.main( args );
+				"Can't find javax.swing package ! ");
 		}
 	}
 }