File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes UnsatisfiedLinkError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "UnsatisfiedLinkError " Watch "UnsatisfiedLinkError " New topic
Author

UnsatisfiedLinkError

vin Hari
Ranch Hand

Joined: Nov 16, 2006
Posts: 161
Hello Experts,
iam running a client server program in all operating system since java is platform independent thats why i have choosen to program in that it is working fine in windows and unix but when iam running in the linux it is showing
java.lang.UnsatisfiedLinkError with following statements


as i have never encountered this exception previously i didnt understand what exactly the problem please help me please tell what it exactly represents iam just using normal java swing applications which comes in awt package because it is working in unix and windows but only in linux it is causing problem and also iam uisng 64 bit machine of linux whether this matter whether i should use 32 bit please help me, please give me some clear idea of above all.
Thanks in advance.
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 349

what is your JRE, Sun's or some other?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

/usr/lib64/libgcj.so.5.0.0

This part of the code shows that you are running GNU Java, which comes standard with most Linux distributions because it's a fully open-source version of Java.

Unfortunately, GNU Java is an incomplete and very slow implementation of Java 1.4.

Install Sun's Java for Linux and use that instead of GNU Java. How you should do that depends on what flavour of Linux you are using. For Ubuntu it would be:


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
vin Hari
Ranch Hand

Joined: Nov 16, 2006
Posts: 161
Thank you ,
for reply please may i know is there any way to know which JRE my system is using so that i can check which JRE linux is using so that i can replace it please tell me.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Type

from your console.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
vin Hari
Ranch Hand

Joined: Nov 16, 2006
Posts: 161
thank you for your quick reply,
please can you tell me how can i know that GNU is installed here not the suns JRE is there any way, and also how to install this JRE in lnux as iam new to linux please experts help me.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

If let's say you have GNU Java installed, you'll see something like when you enter java -version.

whereas for Sun Java, you'll see something like this.


Which Linux distro do you use? If you use, Ubuntu or any Debian-based distro. it's very simple. Type this from your terminal.

For other distros, it's a bit complicated because you need to download it manually and replace the GNU Java with Sun Java.

Hope this helps.
vin Hari
Ranch Hand

Joined: Nov 16, 2006
Posts: 161
Thank you thanks a lot,
really it is worth but when i did the java -version in linux
i got the message like this


can you please tell me what it suggest and what i should do for this,
thanks in advance.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

vin, you are using GNU Java. Install Sun Java instead.

Henry and I have already suggested that you install Sun Java. How to do that exactly depends on what Linux distribution you are using. It looks like you are using Red Hat Linux (probably Fedora or RHEL). Lookup in the documentation of your Linux distribution how to install Java using the package management system.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

Some things to watch out for:

There are 2 ways to install Sun Java on Red Hat/Fedora. One is via an RPM, the other is using the generic ".bin" install, which works for all Linux systems. The only thing special that the RPM does is:

1. Installs the JDK as a subdirectory tree under /usr/java
2. Makes a note in the RPM database that you've installed that particular package.

Other than the above, an install from the bin or an install from an RPM give exactly the same results. I recommend that if you do install from the bin, you move the installed JDK under /usr/java (you may have to create this directory). I like keeping my JVMs and JDKs in a common location - makes them easier to keep up with.

Modern-day releases of Fedora and Ubuntu Linux install gcj as part of the default install, and they wired it in using the Debian "alternatives" system. if you do a "ls -l /usr/bin/java", you can see part of that mechanism.

You can tell the alternatives system to use other Java implementations, though it's not pretty. However, many of the J2EE systems reference an environment variable named JAVA_HOME, so a good way to handle this is to put something like the following in your ".bash_profile":



I'm setting up environments for Maven and Ant at the same time. You don't have to go that far if you don't want to.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: UnsatisfiedLinkError
 
Similar Threads
Problem running java program
Classpath problem?
IOException while executing runtime.exec
Jni error
How to compile hello world in eclipse?