Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Another unsatisfied link error
Another unsatisfied link error [message #251672] Sun, 16 March 2008 10:14 Go to next message
Bradley Atkins is currently offline Bradley AtkinsFriend
Messages: 18
Registered: July 2009
Junior Member
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: Another unsatisfied link error [message #251678 is a reply to message #251672] Sun, 16 March 2008 15:04 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
1. You should use Eclipse 3.3 and SWT 3.3 because then the native libs
are extracted by the SWT.jar itself

2. If you want to use Eclipse 3.2 and SWT 3.2 you have to start your
program with
-Djava.library.path=/home/brad/.eclipse/org.eclipse.platform _3.2.0/configuration/org.eclipse.osgi/bundles/71/1/.cp/

or better copy the .so-Files to a common directory and point
java.library.path to it.

Tom

Bradley schrieb:
> 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
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Another unsatisfied link error [message #251692 is a reply to message #251672] Mon, 17 March 2008 08:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Bradley" <himself@bradleyatkins.com> wrote in message
news:9e19353fb7c301dace6d616d2b760f86$1@www.eclipse.org...
>I will post this here even though hardly anyone seems to visit this forum
>as I cannot find another appropriate forum in the list.

Looks like Tom has answered your main question, leaving me to comment: Huh?
"Hardly anyone seems to visit this forum"? There are dozens of messages to
eclipse.newcomer daily, and more than half get responses. And as for
finding an appropriate forum, although eclipse.newcomer is fine,
eclipse.platform.swt would also seem a good place to ask SWT questions.
Respectfully, if you're not seeing all the traffic or the full newsgroup
list, you may want to check into some different newsreading sofware.
Re: Another unsatisfied link error [message #251720 is a reply to message #251678] Mon, 17 March 2008 22:41 Go to previous messageGo to next message
Bradley Atkins is currently offline Bradley AtkinsFriend
Messages: 18
Registered: July 2009
Junior Member
Thank you very much Tom, first time I have received a reply that actually
answered the question, even though I don't fully understand why it works
yet! :)

I pasted the line -

-Djava.library.path=/home/brad/.eclipse/org.eclipse.platform _3.2.0/configuration
/org.eclipse.osgi/bundles/71/1/.cp/

into the VM Arguments box on the run dialogue and the example I was trying
to run kicked off fine without the link error. So is the problem that I am
using Eclipse 3.2 and SWT 3.3?

You say I need to install Eclipse 3.3 and SWT 3.3. I am a newcomer to
ubuntu and relied on the Synaptic Package Manager to install Eclipse
however it only lists 3.2 for Eclipse.

I have found Eclipse 3.3.2 and SWT 3.3.2 on the site
http://download.eclipse.org/eclipse/downloads/drops/R-3.3.2- 200802211800/index.php
are these the ones you mean?

Thanks for the help

Bradley
Re: Another unsatisfied link error [message #251723 is a reply to message #251692] Mon, 17 March 2008 22:47 Go to previous messageGo to next message
Bradley Atkins is currently offline Bradley AtkinsFriend
Messages: 18
Registered: July 2009
Junior Member
Thank you Walter

Looks like you are right, I have never used a news reader before and have
recently installed Thunderbird on my Ubuntu laptop. It shows my post but
not your reply.

Worse when I logged into this site using Firefox I saw that I had two
replies but when I tried opening another window so I could see your reply
while I responded to it I found that your answers had disappeared from the
listing again so it looked as though no one had responded again. ??

So perhaps you could help me out by either telling me how to configure
Thunderbird or Firefox to see the posts correctly or recommend another
news reader for me?

Many thanks

Bradley
Re: Another unsatisfied link error [message #251733 is a reply to message #251720] Mon, 17 March 2008 23:19 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Well SWT is a 2 fold thing:
- Java-Code providing a uniform API for all Windowing-Toolkits
- Native C, Objective-C for binding to the native .dlls, .sos, ...

If you are using Eclipse 3.2 which use SWT-3.2 you need to point your
java-vm to the location this native component can be found. Since 3.3
SWT-Code holds magic to unpackage the native part into a temporary
location and load it from there.

The URL you pointed to is the latest stable release simply download it,
unpack it to some location and fire it up.

Tom


Bradley schrieb:
> Thank you very much Tom, first time I have received a reply that
> actually answered the question, even though I don't fully understand why
> it works yet! :)
>
> I pasted the line -
> -Djava.library.path=/home/brad/.eclipse/org.eclipse.platform _3.2.0/configuration
>
> /org.eclipse.osgi/bundles/71/1/.cp/
> into the VM Arguments box on the run dialogue and the example I was
> trying to run kicked off fine without the link error. So is the problem
> that I am using Eclipse 3.2 and SWT 3.3?
>
> You say I need to install Eclipse 3.3 and SWT 3.3. I am a newcomer to
> ubuntu and relied on the Synaptic Package Manager to install Eclipse
> however it only lists 3.2 for Eclipse.
>
> I have found Eclipse 3.3.2 and SWT 3.3.2 on the site
> http://download.eclipse.org/eclipse/downloads/drops/R-3.3.2- 200802211800/index.php
>
> are these the ones you mean?
>
> Thanks for the help
>
> Bradley
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Another unsatisfied link error [message #251741 is a reply to message #251723] Mon, 17 March 2008 23:34 Go to previous messageGo to next message
Mark Dexter is currently offline Mark DexterFriend
Messages: 324
Registered: July 2009
Senior Member
Bradley wrote:
> Thank you Walter
>
> Looks like you are right, I have never used a news reader before and
> have recently installed Thunderbird on my Ubuntu laptop. It shows my
> post but not your reply.
> Worse when I logged into this site using Firefox I saw that I had two
> replies but when I tried opening another window so I could see your
> reply while I responded to it I found that your answers had disappeared
> from the listing again so it looked as though no one had responded
> again. ??
>
> So perhaps you could help me out by either telling me how to configure
> Thunderbird or Firefox to see the posts correctly or recommend another
> news reader for me?
>
> Many thanks
>
> Bradley
>
>
Hi Bradley. Thunderbird works fine, although it took me a few tries to
get it set up correctly. It turns out I didn't have the correct login id
and password for the newsgroup account. I think all you need to do is go
File/New/Account, select Newsgroup Account, and put news.eclipse.org for
the server name. You will need to know your login id and password. Once
you have this set up correctly, Eclipse News will show up in the tree on
the left. Then you can right-click Eclipse News and select subscribe.
Expanding the eclipse tree shows you all of the available newsgroups.
Hope this helps. Mark
Re: Another unsatisfied link error [message #251797 is a reply to message #251720] Tue, 18 March 2008 16:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Bradley" <himself@bradleyatkins.com> wrote in message
news:6b6afbe1e25a6cf078b732d15598236e$1@www.eclipse.org...
> You say I need to install Eclipse 3.3 and SWT 3.3. I am a newcomer to
> ubuntu and relied on the Synaptic Package Manager to install Eclipse
> however it only lists 3.2 for Eclipse.

I'm not a Linux user at all. However, there have been a number of reports
of problems with Ubuntu's Eclipse and javac distribution; if you Google
"eclipse gcj ubuntu" you'll probably find details. Suffice it to say that
if you are using Ubuntu, you should DEFINITELY make sure that you have
installed a recent version of the Sun JDK and you should point Eclipse to it
explicitly, by using the -vm option on the command line or in eclipse.ini.
Re: Another unsatisfied link error [message #251801 is a reply to message #251733] Tue, 18 March 2008 19:21 Go to previous messageGo to next message
Bradley Atkins is currently offline Bradley AtkinsFriend
Messages: 18
Registered: July 2009
Junior Member
Hi Tom

Thanks for the help, unfortunately it seems that a little more than just
firing it up is required, this is the story so far: -

1) I used the package manager to uninstall eclipse 3.2 and downloaded the
3,3 version to /home/brad/eclipse.

2) Launching eclipse from the command line gives: -
The program 'eclipse' is currently not installed. You can install it by
typing:
sudo apt-get install eclipse
bash: eclipse: command not found

Needless to say using apt-get kicks off an install of 3.2

3) Launching eclipse by clicking on it in explorer gives the error
message:-
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/home/brad/eclipse/jre/bin/java
java in your current PATH

4) As far as I am aware Java is installed at: -
/usr/lib/jvm/java-1.5.0-sun/jre/bin/

this directory certainly contains a java and java_jvm executable.

I have tried adding this location to my PATH variable but it does not seem
to make any difference to the error message about no JRE.

Any suggestions?
PS [message #251804 is a reply to message #251801] Tue, 18 March 2008 19:43 Go to previous messageGo to next message
Bradley Atkins is currently offline Bradley AtkinsFriend
Messages: 18
Registered: July 2009
Junior Member
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?
Re: PS [message #251806 is a reply to message #251804] Tue, 18 March 2008 20:37 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Brad,

Could be. I'm not a Linux-User you could also start your eclipse with
-vm pointing to your Java-Installation.

Tom

Bradley schrieb:
>
> 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?
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: PS [message #251937 is a reply to message #251804] Thu, 20 March 2008 04:17 Go to previous message
Eclipse UserFriend
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
Previous Topic:Install PHP Manual in Eclipse
Next Topic:Problems with upgrading and plugins
Goto Forum:
  


Current Time: Thu Mar 28 08:06:09 GMT 2024

Powered by FUDForum. Page generated in 0.04343 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top