How to execute project with JOGL library? - java

I'm developing Java project with JOGL, but when I'm trying to execute my project I'll got the following message:
Catched FileNotFoundException: E:\Eclipse\Projects\FuzzyProject\lib\jogl2-rc10\gluegen-natives-windows-i586.jar (Can't find file), while TempJarCache.bootstrapNativeLib() of jar:file:/E:/Eclipse/Projects/FuzzyProject/lib/jogl2-rc10/gluegen-natives-windows-i586.jar!/ (file:/E:/Eclipse/Projects/FuzzyProject/lib/jogl2-rc10/ + gluegen-natives-windows-i586.jar)
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path
How can I fix this problem?

From console java -Djava.library.path=<path to native library> -jar (if jar) <name of jar or class>
From code just System.loadLibrary(<path to native library>)
From Eclipse: Run Configuration -> Arguments -> VM Argiments->-Djava.library.path=<path to native library>

I assume you're running this from eclipse and on a windows machine, so have a look here: I installed JOGL but why wont Eclipse recognize my hello world program?
For gluegen, have a look here: java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path RCP Application

Related

JAR File is working in Eclipse but not in CMD ( java.lang.RuntimeException: Environment (windows) with architecture (x86) is not supported)

Im trying to create a Voice assitant using Java. Im using the Picovoice API. Java Eclipse runs my code perfectly without any Issues, but when I export the project as Runnable JAR and run it through my cmd ("java -jar WakeWord.jar") Im getting this Error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at ai.picovoice.porcupine.Porcupine$Builder.build(Porcupine.java:204)
at de.VoiceRecognition.ball.WakeWordDetection.main(WakeWordDetection.java:73)
Caused by: java.lang.RuntimeException: Environment (windows) with architecture (x86) is not supported by Porcupine.
at ai.picovoice.porcupine.Utils.getArchitecture(Utils.java:196)
at ai.picovoice.porcupine.Utils.<clinit>(Utils.java:41)
... 2 more
Im confused because it works in the Eclipse IDE but not on my Desktop through CMD Prompt on Windowsx86(AMD64).

Including libraries generating jar and executing with java -jar on Intellij

I've been trying to execute a jar file through command line but I'm still getting an exception that I'm missing a library even though it was properly added as it's shown here. The library that I'm trying to run my code with is the opencv's lib. I'm able to run my app from intellij and generate a jar artifact that I can see the jar grows in size when I add the opencv lib but when I try to run the app from the command line with "java -jar Test.jar" I get the message that I'm missing the opencv library.
rinaldi#rinaldi-work:~/Projects/Test/out/artifacts/Test_jar$ java -jar Test.jar Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java310 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at HelloWorld.<clinit>(HelloWorld.java:14)
at Main.main(Main.java:4)
I've also tried to run the app adding the path to the opencv's library:
:~/Projects/Test/out/production/Test$ java -cp .:~/Sources/opencv-master/build/bin/opencv-310.jar Main
And another attempt because opencv needs not only it's jar but also the /opencv-master/build/lib/ directory:
:~/Projects/Test/src$ java -cp :/home/rinaldi/Sources/opencv-master/build/bin/opencv-310.jar:/home/rinaldi/Sources/opencv-master/build/lib/ Main
Below are the images from intellij's configuration.
I had to add the library this way:
java -jar -Djava.library.path=/home/rinaldi/Sources/opencv-master/build/lib test.jar
Hope this helps someone.

java.lang.UnsatisfiedLinkError when i load a jar .

I ' m programming with JSE and i'm loading a jar (that i do ) with another java program .
The problem is in classLoader of java virtual machine i think .
i said that beacuse i tried to exec the file jar with java -jar "file.jar" and it runs .
I'm using xubuntu with eclipse.
In eclipse, i have 2 project that respectively are the first software that loads jar and the jar software .
To export the jar file i use the wizard "Export -> jar ecc...."
How can i resolve this problem?
Exception in thread "main" java.lang.UnsatisfiedLinkError: /media/sda4/so_project/proj/example/first.jar: /media/sda4/so_project/proj/example/first.jar: invalid ELF header (Possible cause: endianness mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at it.unicam.project.Binterpreter.getClassHandle(Binterpreter.java:170)
at it.unicam.project.Binterpreter.(Binterpreter.java:100)
at it.unicam.project.Test.main(Test.java:12)
That's because you're running a 32bit JVM on a 64bit platform

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no jnotify in java.library.path

I have configure Jnotify on Mac OS X. i am using MyEclipse and latest version of Jnotify. I am new to MAC OS and just added jnotify.jar and also added jnotify.dylib as a native library Its workling in development enviornment but when i create an executeable jar and run it on Mac OS X it will not work and the following exception has occured
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no jnotify in java.library.path
Insert the following debug line in your code: System.getProperty("java.library.path");
If possible as the first line of your Main method.
Then run the executable jar and look at the path it prints. Now make sure that jnotify.dylib is located in one of the directories that the path displays.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no Terminal in java.library.path

I was trying to run the CHARVA Tutorial thru Eclipse after setting up the JAR,
but I receive
Exception in thread "main" java.lang.UnsatisfiedLinkError: no Terminal in java.library.path
in the console. Any clue on how to fix this up?
As Dave said, Charva requires a native library called Terminal to run. As far as I remember, it is included in the binary distribution for Charva.
Eclipse-specific instructions: In your project properties, select Java Build Path, then Libraries. Locate the jar and set the Native library location to the path where the Terminal library is.

Categories

Resources