CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    48

    My jdk1.2.2 for win98 is not working properly...

    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, [email protected]

    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);
    }
    }



  2. #2
    Join Date
    Mar 2000
    Location
    Manila, Philippines
    Posts
    1

    Re: My jdk1.2.2 for win98 is not working properly...

    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>

  3. #3
    Join Date
    Apr 1999
    Posts
    48

    Re: My jdk1.2.2 for win98 is not working properly...

    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);
    }
    }



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured