Another unsatisfied link error [message #251672] |
Sun, 16 March 2008 06:14  |
Eclipse User |
|
|
|
I will post this here even though hardly anyone seems to visit this forum
as I cannot find another appropriate forum in the list.
I am trying to compile and run a simple example from the swt examples I
downloaded, here it is a scrith class from a scratch project: -
import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class Scritch {
public static void main (String [] args) {
System.out.println("java.library.path="+System.getProperty( "java.library.path"));
Display display = new Display ();
Shell shell = new Shell (display);
FillLayout fillLayout = new FillLayout ();
shell.setLayout (fillLayout);
Button button0 = new Button (shell, SWT.PUSH);
button0.setText ("button0");
shell.pack ();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ())
display.sleep ();
}
display.dispose ();
}
}
This gives me yet another unsatisfied link error as I struggle to get to
grips with Java, most frustrating: -
Exception in thread "main" java.lang.UnsatisfiedLinkError: no
swt-pi-gtk-3236 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:12 3)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java: 63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java: 54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:126)
at Scritch.main(Scritch.java:8)
The only reference I can find to swt-pi-gtk-3236 on my system (ubuntu
7.10) is: -
/home/brad/.eclipse/org.eclipse.platform_3.2.0/configuration /
org.eclipse.osgi/bundles/71/1/.cp/libswt-pi-gtk-3236.so
Do I need to add a reference to this somewhere in the project?
Thanks
Brad
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: PS [message #251937 is a reply to message #251804] |
Thu, 20 March 2008 00:17  |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Bradley wrote:
>
> Although I seem to have two installs of JAVA: -
>
> root@VaioTX-5XN:/usr/lib/jvm# ls
>
> java-1.5.0-sun java-1.5.0-sun-1.5.0.13
>
> if I type which java at the command prompt I get nothing, yet I am
> fairly sure I used to before I uninstalled eclipse 3.2, do you think I
> managed to uninstall java even though the files are there?
>
It is always a good idea to explicitly tell Eclipse what JVM to use,
rather than rely on it to discover one. See this page for details:
http://wiki.eclipse.org/Eclipse.ini
Note that the path has to point to the java executable, not just the
directory that contains it.
Hope this helps,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.11742 seconds