• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

SWT dll at Hobbes

Started by lpino, 2009.10.25, 15:52:55

Previous topic - Next topic

lpino

Couple days ago I uploaded to Hobbes a file named ControlExample.zip that contains the port of SWT as is today and a test program used to try the behavior of the different controls.

I'm still looking for people to help me finish the port, so if anyone is interested just contact me.


Thanks

cytan

Hi lpino,
   I tried running it but got the following error:

[D:\tmp\swt]java -classpath swt.jar;swtexamples.jar org.eclipse.swt.examples.controlexample.ControlExample
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\tmp\swt\swtp2049.dll: Invalid EXE signature in %1
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1511)
        at java.lang.Runtime.loadLibrary0(Runtime.java:788)
        at java.lang.System.loadLibrary(System.java:834)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:117)
        at org.eclipse.swt.internal.pm.OS.<clinit>(OS.java:34)
        at org.eclipse.swt.widgets.Display.internal_new_GC(Display.java:1091)
        at org.eclipse.swt.graphics.Device.init(Device.java:700)
        at org.eclipse.swt.widgets.Display.init(Display.java:1115)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:106)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:288)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:284)
        at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlEx
ample.java:96)
******************

I'm running:

[D:\tmp\swt]java -version
java version "1.4.2_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05)
Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)


****

cytan

lpino

The SWT port needs a native JVM and in the case of the Java 1.4.2 we are talking about a Win32 version running on OS/2 using ODIN.

You need any of the follwing:
- IBM Java 1.3
- IBM Java 1.3.1
- Java 1.4.1 (Golden Code edition) *untested

Sorry if I wasn't more specific on the requirements.

Thanks for trying it at least.


abwillis

Interesting... running 1.5 using the Java 1.4.2 executables gets this error but Java 1.4.2 works fine.   GC 1.4.1 also gets almost the same error here :
e:\tmp\unzip\controlexample-1.zip.834[0]examples.cmd
java -classpath swt.jar;swtexamples.jar org.eclipse.swt.examples.controlexample.
ControlExample
java.lang.UnsatisfiedLinkError: E:\tmp\unzip\ControlExample-1.zip.834\swtp2049.d
ll: Error 2 loading E:\tmp\unzip\ControlExample-1.zip.834\swtp2049.dll. CPPRMI40
contributed

below this its the same.


lpino

Quote from: abwillis on 2009.10.27, 05:45:12
Interesting... running 1.5 using the Java 1.4.2 executables gets this error but Java 1.4.2 works fine.   GC 1.4.1 also gets almost the same error here :
e:\tmp\unzip\controlexample-1.zip.834[0]examples.cmd
java -classpath swt.jar;swtexamples.jar org.eclipse.swt.examples.controlexample.
ControlExample
java.lang.UnsatisfiedLinkError: E:\tmp\unzip\ControlExample-1.zip.834\swtp2049.d
ll: Error 2 loading E:\tmp\unzip\ControlExample-1.zip.834\swtp2049.dll. CPPRMI40
contributed

below this its the same.



I don't understand what works from your post. The example works with 1.4.2?... that would be weird,, to say the least.

As for the UnsatisfiedLinkError,, looks like a DLL is missing. Since I have the whole environment set maybe I need to add a runtime dll from VAC++ or include it in the linking process. Can you send me the whole message.

Finally, can someone try with Java 1.3.x?

Thanks

abwillis

1.4.2 works fine here.  No longer have 1.3 to try. 

1.4.1 fails here:
e:\tmp\unzip\controlexample.zip.069[0]examples.cmd
java -classpath swt.jar;swtexamples.jar org.eclipse.swt.examples.controlexample.
ControlExample
java.lang.UnsatisfiedLinkError: E:\tmp\unzip\ControlExample.zip.069\swtp2049.dll
: Error 2 loading E:\tmp\unzip\ControlExample.zip.069\swtp2049.dll. CPPRMI40 con
tributed
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
        at java.lang.Runtime.loadLibrary0(Runtime.java:788)
        at java.lang.System.loadLibrary(System.java:832)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:117)
        at org.eclipse.swt.internal.pm.OS.<clinit>(OS.java:34)
        at org.eclipse.swt.widgets.Display.internal_new_GC(Display.java:1091)
        at org.eclipse.swt.graphics.Device.init(Device.java:700)
        at org.eclipse.swt.widgets.Display.init(Display.java:1115)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:106)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:288)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:284)
        at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlEx
ample.java:96)

Java 1.5:
e:\tmp\unzip\controlexample.zip.069[0]examples.cmd
java -classpath swt.jar;swtexamples.jar org.eclipse.swt.examples.controlexample.
ControlExample
Exception in thread "main" java.lang.UnsatisfiedLinkError: E:\tmp\unzip\ControlE
xample.zip.069\swtp2049.dll: Invalid EXE signature in %1
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:117)
        at org.eclipse.swt.internal.pm.OS.<clinit>(OS.java:34)
        at org.eclipse.swt.widgets.Display.internal_new_GC(Display.java:1091)
        at org.eclipse.swt.graphics.Device.init(Device.java:700)
        at org.eclipse.swt.widgets.Display.init(Display.java:1115)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:106)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:288)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:284)
        at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlEx
ample.java:96)

buca

lpino:

I tried with 1.3.1 and works fine.

That's a very good work.

Dani

cytan

Tried both 1.3.1 and 1.4.1 and got the same results. Maybe something else (like CPPRMI40.dll) is needed or my path is screwed up:

*****************
[D:\tmp\swt]e:/java141/bin/java -classpath swt.jar;swtexamples.jar org.eclipse.swt.examples.controlexample.ControlExample
java.lang.UnsatisfiedLinkError: D:\tmp\swt\swtp2049.dll: Error 2 loading D:\tmp\swt\swtp2049.dll. CPPRMI40 contributed
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
        at java.lang.Runtime.loadLibrary0(Runtime.java:788)
        at java.lang.System.loadLibrary(System.java:832)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:117)
        at org.eclipse.swt.internal.pm.OS.<clinit>(OS.java:34)
        at org.eclipse.swt.widgets.Display.internal_new_GC(Display.java:1091)
        at org.eclipse.swt.graphics.Device.init(Device.java:700)
        at org.eclipse.swt.widgets.Display.init(Display.java:1115)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:106)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:288)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:284)
        at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlExample.java:96)
*************

[D:\tmp\swt]e:/java131/jre/bin/java -classpath swt.jar;swtexamples.jar org.eclipse.swt.examples.controlexample.ControlExample
java.lang.UnsatisfiedLinkError: D:\tmp\swt\swtp2049.dll: Unable to load D:\tmp\swt\swtp2049.dll.DLL (OS/2 RC = 2 reason = 'CPPRMI40')
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1799)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1685)
        at java.lang.Runtime.loadLibrary0(Runtime.java:780)
        at java.lang.System.loadLibrary(System.java:865)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:117)
        at org.eclipse.swt.internal.pm.OS.<clinit>(OS.java:34)
        at org.eclipse.swt.widgets.Display.internal_new_GC(Display.java:1091)
        at org.eclipse.swt.graphics.Device.init(Device.java:700)
        at org.eclipse.swt.widgets.Display.init(Display.java:1115)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:106)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:288)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:284)
        at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlExample.java:96)
Exception in thread "main"


lpino

Quote from: cytan on 2009.10.29, 22:55:51
Tried both 1.3.1 and 1.4.1 and got the same results. Maybe something else (like CPPRMI40.dll) is needed or my path is screwed up:


Well I'm going to upload the package again, including CPPRMI40.dll.

Thanks for the feedback, but remember to check the blog at: http://os2advocacy.blogspot.com/. There are more details there.


abwillis

Quote from: lpino on 2009.10.30, 02:31:05
Quote from: cytan on 2009.10.29, 22:55:51
Tried both 1.3.1 and 1.4.1 and got the same results. Maybe something else (like CPPRMI40.dll) is needed or my path is screwed up:


Well I'm going to upload the package again, including CPPRMI40.dll.

Thanks for the feedback, but remember to check the blog at: http://os2advocacy.blogspot.com/. There are more details there.

Java 1.4.1 and 1.4.2 both work here now.   Java 1.5 gives a new error:

e:\tmp\unzip\controlexample.zip.700[1]examples.cmd
java -classpath swt.jar;swtexamples.jar org.eclipse.swt.examples.controlexample.
ControlExample
Exception in thread "main" org.eclipse.swt.SWTError: No more handles
        at org.eclipse.swt.SWT.error(SWT.java:2144)
        at org.eclipse.swt.SWT.error(SWT.java:2051)
        at org.eclipse.swt.widgets.Display.error(Display.java:520)
        at org.eclipse.swt.widgets.Display.init(Display.java:1142)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:106)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:288)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:284)
        at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlEx
ample.java:96)


lpino

Quote from: abwillis on 2009.10.30, 04:58:46
Quote from: lpino on 2009.10.30, 02:31:05
Quote from: cytan on 2009.10.29, 22:55:51
Tried both 1.3.1 and 1.4.1 and got the same results. Maybe something else (like CPPRMI40.dll) is needed or my path is screwed up:


Well I'm going to upload the package again, including CPPRMI40.dll.

Thanks for the feedback, but remember to check the blog at: http://os2advocacy.blogspot.com/. There are more details there.

Java 1.4.1 and 1.4.2 both work here now.   Java 1.5 gives a new error:

e:\tmp\unzip\controlexample.zip.700[1]examples.cmd
java -classpath swt.jar;swtexamples.jar org.eclipse.swt.examples.controlexample.
ControlExample
Exception in thread "main" org.eclipse.swt.SWTError: No more handles
        at org.eclipse.swt.SWT.error(SWT.java:2144)
        at org.eclipse.swt.SWT.error(SWT.java:2051)
        at org.eclipse.swt.widgets.Display.error(Display.java:520)
        at org.eclipse.swt.widgets.Display.init(Display.java:1142)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:106)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:288)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:284)
        at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlEx
ample.java:96)



Ok, those are good news. Now I have no idea why java 1.4.2 works for you, it shouldn't. Probably you have some config that makes you believe you are using 1.4.2 when you are really using 1.4.1

I've been working in solving problems with icons. This has been slow since I have to go over others people's code, and that never is that easy.

If anyone wants to compare with the Windows version of this test it should point their browsers to:

http://www.eclipse.org/swt/jws/controlexample.jnlp

PS. That URL starts Java Web Start and it's at version SWT 3.5 (includes many more controls). The SWT port is at level 2.1 (very old)

Thanks

cytan

I can confirm that with the inclusion of cpprmi40.dll in the distribution, examples.cmd works with both java131 and java141. java142 does not work as expected.

There's a small redraw corruption with the Button examples when going from SWT.check to SWT.radio. Not a biggie.

Other than what I've seen so far, great job!

cytan

lpino

Quote from: cytan on 2009.10.30, 16:01:29
I can confirm that with the inclusion of cpprmi40.dll in the distribution, examples.cmd works with both java131 and java141. java142 does not work as expected.

There's a small redraw corruption with the Button examples when going from SWT.check to SWT.radio. Not a biggie.

Other than what I've seen so far, great job!

cytan

There should be a very ugly stack thrown on the VIO window when you close the example after clicking on any button.
Can anyone confirm this please?.

PS. We really should take this thread to the blog page.

Thanks

cytan

You mean this:
*******************
org.eclipse.swt.SWTException: Widget is disposed
        at org.eclipse.swt.SWT.error(SWT.java:2119)
        at org.eclipse.swt.SWT.error(SWT.java:2051)
etc.
******************

when I close the app after selecting and pushing a few buttons?

cytan

abwillis

#14
Quote
Ok, those are good news. Now I have no idea why java 1.4.2 works for you, it shouldn't. Probably you have some config that makes you believe you are using 1.4.2 when you are really using 1.4.1
That I can guarantee is not happening by several indicators.
1.  I almost never use 1.4.1 and I have nothing in config.sys for any java anyhow.

2.  e:\tmp\unzip\controlexample.zip.700[0]java -version
java version "1.4.2_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05)
Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)

e:\tmp\unzip\controlexample.zip.700[0]java -fullversion
java full version "1.4.2_09-b05"

3.  When launched they look very different and 1.4.2 is more stable with the example, whereas 1.4.1 crashes (this is one of the beta's I've kept around for testing as I had decided to wait for GCD 1.4.2 release before purchasing).

4.  I checked via Theseus.

Hopefully my screenshot is being attached so that you can see what I mean by the visual differences.  The one with 1.4.1 is on the top, the one below it is 1.4.2.  The 1.4.1 version integrates with my system better in such things as checkboxes show x instead of a checkmark which my system is set to do but the Innotek one does not do that integration.  

Andy



Just fixed quote tag -Rob