import java.awt.*;
public class cherry {
static Frame f = new Frame("cherry");
public static void main(String[] a) {
f.resize(300,100);
f.show();
}
}
compiled OK but when I ran it I got:
java.lang.UnsatisfiedLinkError: setScopePermission
at sun.awt.motif.MToolkit.<clinit>(MToolkit.java:34)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:190)
at java.awt.Window.getToolkit(Window.java:139)
at java.awt.Frame.addNotify(Frame.java:82)
at java.awt.Window.show(Window.java:93)
at cherry.main(cherry.java:8)
java.lang.UnsatisfiedLinkError: init
at sun.awt.motif.MToolkit.<init>(MToolkit.java:39)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:190)
at java.awt.Window.getToolkit(Window.java:139)
at java.awt.Frame.addNotify(Frame.java:82)
at java.awt.Window.show(Window.java:93)
at cherry.main(cherry.java:8)
An suggestions or links would be greatly appreciated.
Thanks,
Jeremy Loss
USGS, Woods Hole MA
There's nothing wrong with your code -- I just cut'n'pasted it into
a file, compiled and ran it fine. It compiles and runs under both
JDK 1.1 and JDK 1.0.2 by the way. So it must be something in your
environment or elsewhere.
Those error messages are saying that it could not create the peer
(native window system) frame for that Frame.
I suggest you do the following:
1. check CLASSPATH -- maybe you are picking up a different
version of "cherry" from an earlier entry in the CLASSPATH
2. delete all .class file in the directory, and recompile
javac -verbose cherry.java
3. look for weird stuff in step 2 -- are you compiling and
using the libraries you expected?
4. run with
java -verbose cherry
again, check that you are getting what you think you're getting.
If that still doesn't work for you, send me email with the results,
and I'll see if I can resolve it. Also if it does fix it, let me
know what the problem was, so I can get better at diagnosis.
Peter
--
Peter van der Linden linden%nos...@eng.sun.com http://www.best.com/~pvdl
If you give a man a fish, he can eat for a day.
If you give a man a fishing rod, he can sell it and get a good steak dinner.