Click to See Complete Forum and Search --> : My jdk1.2.2 for win98 is not working properly...


ytsau
March 1st, 2000, 11:15 PM
Hi gurus,

I have been using Visual J++ 1.1 for quite a while. I write applet-application programs which can be executed either within HTML or jview.exe provided with Visual J++. Today, I downloaded JDK 1.2.2 and installed on my PC. The compiler javac.exe seems OK, although it gave warning in the this line: frame.resize(100,100);

However, when I ran the java class with java.exe, it gave serious error message, as shown below:

C:\javatest>java javatest
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\jdk122\jre\bin\awt
.dll: An attempt was made to load a program with an^M
incorrect format
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1319)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1235)
at java.lang.Runtime.loadLibrary0(Runtime.java:470)
at java.lang.System.loadLibrary(System.java:778)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:57)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:882)
at java.awt.Toolkit.<clinit>(Toolkit.java:903)
at java.awt.Component.<clinit>(Component.java:258)

Anybody can help me out of this? Thanks in advance, ytsau@usa.net

P.S. the Java program runs fine with jview.exe (the same compiled class). The source code is attached as follows:

import java.applet.Applet;
import java.awt.*;
public class java10 extends Applet
{
public static void main(String args[]) {
System.out.println("hello");
}
public void paint(Graphics g) {
g.drawString("hello", 10, 20);
}
}

kitbrownfox
March 2nd, 2000, 02:03 AM
your source code is ok. although i am quite confused. should your command be c:\javatest\java java10 instead of c:\javatest\java javatest?

maybe you have not properly configured your jdk1.2.2 installation? by configured, i mean adding the path to c:\jdk1.2.2\bin to the current path.

command is
set path=%path%;c:\jdk1.2.2\bin;

i hope i answered your question.

<b>KITBROWNFOX</b>

ytsau
March 2nd, 2000, 08:01 AM
Thanks for the reply.

I did set "PATH=%PATH%;c:\jdk122\bin;" in autoexec.bat. Actually, javac.exe and java.exe can be executed from my java code directory. If I take "extends Applet" out, the programm runs fine with java.exe and jview.exe (but not any more with HTML). I guess something is wrong that prevents java.exe from loading java.applet.Applet or java.awt.*. In the error message lines, it says "UnsatisfiedLinkError: C:\jdk122\jre\bin\awt.dll: An attempt was made to load a program with...". I don't know how to satisfy it. :-(

Thanks again, ytsau

P.S. Sorry for the confusion. I put the wrong class name by mistake. The code should be like this:
import java.applet.Applet;
import java.awt.*;
public class javatest extends Applet
{
public static void main(String args[]) {
System.out.println("hello");
}
public void paint(Graphics g) {
g.drawString("hello", 10, 20);
}
}