PDA

View Full Version : has anyone implemented the java network interface (jni) in fedora8?



susmit_koirala
21st April 2008, 06:14 PM
I tried to develop a GUI interface in java for a c program i had developed and everything went right until when i tried to run the final code

Exception in thread "main" java.lang.UnsatisfiedLinkError: no hello.so in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1700)
at java.lang.Runtime.loadLibrary0(Runtime.java:841)
at java.lang.System.loadLibrary(System.java:1067)
at HelloWorld.<clinit>(HelloWorld.java:6)
Error: Could not find the main class.
Error: A JNI error has occurred, please check your installation and try again


After that i searched a lot about how to set this java.library.path so that my shared library works well but all in vain .can anyone help me /????????

RupertPupkin
22nd April 2008, 03:13 AM
You must not have searched hard enough. :)

java -Djava.library.path=put_your_path_here ...

susmit_koirala
22nd April 2008, 04:17 AM
Thank u.But after setting the path a new problem has come up .A following error message has come up.Could you please tell me what the problem could be

Exception in thread "main" java.lang.NoClassDefFoundError: /home/susmit/sixth sem/miscellaneous/interface/second
Caused by: java.lang.ClassNotFoundException: .home.susmit.sixth sem.miscellaneous.interface.second
at java.net.URLClassLoader$1.run(URLClassLoader.java: 221)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:209)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 24)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 69)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:337)
Error: Could not find the main class.
Error: A JNI error has occurred, please check your installation and try again


Further i would like to tell you that the java version that i am using is:
java version "1.7.0"
IcedTea Runtime Environment (build 1.7.0-b21)
IcedTea Client VM (build 1.7.0-b21, mixed mode)

RupertPupkin
22nd April 2008, 05:01 AM
"Class not found" usually means that java can't find the *.class files you are trying to run. Do this command before running your Java program:
export CLASSPATH=.

The "." means the current directory. That way java will be able to find your *.class files in whatever directory you run the program in. You can put that statement in your ~/.bash_profile so that it works every time you login.

susmit_koirala
22nd April 2008, 02:56 PM
:P well actually the class not found exception was generated owing to my silly mistake.

But when i set my path with java -Djava.library.path=put_your_path_here .. and carry on execution the same error message regarding not able to load the shared library............ came up

what shall i do next?????

susmit_koirala
23rd April 2008, 04:21 AM
But when i set my path with java -Djava.library.path=put_your_path_here .. and carry on execution the same error message regarding not able to load the shared library............ came up

what shall i do next?????

Ppl help me common