views:

209

answers:

3

Hello world, I need to run a Java application, which we are trying to port to Java 6, on an NT box.

I manage to run java 5 on it (although not officially supported), but when I try to run java 6 I get the following error:

`Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\Java\jre1.6.0_05\bin\awt.dll: The specified procedure could not be found
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 sun.security.action.LoadLibraryAction.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
    at sun.awt.DebugHelper.<clinit>(Unknown Source)
    at java.awt.EventQueue.<clinit>(Unknown Source)
    at javax.swing.SwingUtilities.invokeLater(Unknown Source)
    at ui.sequencer.test.WindowTest.main(WindowTest.java:136)

Anybody has any idea how to solve this?

This persists even when I move the java executables to another directory with no spaces in its name.

Thanks in advance, Michael

p.s. I know, I should upgrade, but it's not up to me or my company - this is a very very bug huge gigantic company we work with, and they intend to keep NT for another 5 years.

+1  A: 

Java SE 6 requires at least Windows 2000.

Jacek Szymański
I know, but so does java 5, and it still runs (http://java.sun.com/j2se/1.5.0/system-configurations.html).
Michael Bar-Sinai
Probably NT supports same APIs as Windows98SE and ME, but Java6 dropped those from its list.
Jacek Szymański
Mich: Just because one version of a program luckily runs on an unsupported OS is no guarantee the next version does. Java 6 has had some pretty major internal rewrites. As Partyzant says, OSes based on old MS APIs have been removed for Java 6, so they probably cleaned out those dependencies.
Lars Westergren
A: 

I you are not using a GUI, for instance AWT, Swing or SWT, you could try starting you application in headless mode. See http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/ for more information. To start java in headless mode, use java -Djava.awt.headless=true

It would take care of the UnsatisfiedLinkError. I don't know if that's the only obstacle though.

Roel Spilker
thanks, but this is a swing application. Must have a head hear :-(
Michael Bar-Sinai
A: 

OK, Thanks for all the viewers and to @Roel Spiker and @Partyzant for their answers.

It can't be done. Not unless you install windows2000 on the NT box. This is because awt.dll fr J6SE uses new methods in User32.dll, which is part of the windows OS (linked to kernel.dll et al). Use the dll dependency walker and see for yourself. Another possible solution is to alter OpenJDK slightly to use other methods available in windows NT.

Michael Bar-Sinai