Crash in Dynamic Code Evolution VM - java

I am trying to run a Swing Client using Dynamic Code Evolution VM in IntelliJ using DCEVM integration plugin.When I start the app it crashes with following exception
Exception in thread "main" java.lang.UnsatisfiedLinkError: no freetype in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:59)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerNativeLibrary.<clinit>(FontManagerNativeLibrary.java:32)
And
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class sun.font.SunFontManager
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1012)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1624)
at javax.swing.plaf.synth.SynthGraphicsUtils.getPreferredSize(SynthGraphicsUtils.java:283)
at javax.swing.plaf.synth.SynthGraphicsUtils.getMinimumSize(SynthGraphicsUtils.java:195)
at javax.swing.plaf.synth.SynthButtonUI.getMinimumSize(SynthButtonUI.java:461)
I verified that SunFontManager is exist in rt.jar. Any idea?

DCEVM does not ship with fonts. So, when the JVM tries to load up the fonts, it doesn't find any and crashes. Fortunately, the fix is very easy. Simply copy the fonts from another JDK/JRE. You will find them at /jre/lib/fonts. Copy the entire directory to /lib.

Related

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

I am using Linux Mint 17.3.(32 bit operating system). I am trying to make a simple OpenGL program using LWJGL library in NetBeans but it shows following error.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl32 in java.library.path
How can I fix that?

Serial port library giving error java.lang.UnsatisfiedLinkError:

I have downloaded this library from this link http://rxtx.qbang.org/wiki/index.php/Main_Page. I have google a number of pages and first I add via the build path method and add the RXTXcomm.jar. Then I have also add here C:\Program Files(86)\Java\jre7\lib\ext folder also added this .jar file. Yet I still getting this error when I try to run or compile my programme on eclipse
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at read1.TwoWaySerialComm.connect(TwoWaySerialComm.java:21)
at read1.TwoWaySerialComm.main(TwoWaySerialComm.java:108)
You need to set java.library.path when you are starting your program. This will let Java be able to find the native C code that is used in order to talk with the serial ports.
This library as been deprecated. Use new libraries like serialpundit, pyserial etc.

Can't load native library on other systems

I'm developing an application that makes use of libjahspotify. The program is running on my desktop (Windows 7), when attempting to run it on my laptop (Windows 8.1) or on my other Intel NUC (Windows 7) I am getting the below error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\temp\jahspotify.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1083)
at jahspotify.JahSpotifyNativeLoader.<init>(JahSpotifyNativeLoader.java:90)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at java.lang.Class.newInstance(Class.java:438)
at jahspotify.impl.JahSpotifyImpl.<clinit>(JahSpotifyImpl.java:730)
at jahspotify.services.JahSpotifyService.initialize(JahSpotifyService.java:56)
at jahspotify.services.JahSpotifyService.getInstance(JahSpotifyService.java:26)
at jahspotify.services.JahSpotifyService.initialize(JahSpotifyService.java:39)
at net.functionseven.divicantus.spotify.Spotify.init(Spotify.java:29)
at net.functionseven.divicantus.Divicantus.main(Divicantus.java:20)
The native-jar in libjahspotify is supposed to load the dlls automatically, but does not. At this point it seems that jahspotify.dll is not loading. If I manually copy jahspotify.dll to the folder the native-jar will delete it, as its supposed to.
I've recompiled libjahspotify several times and checked it multiple times that both java and the dlls are x86. I've also attempted to load it manually with System.load(), I get a similar error like below.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: C:\temp\jahspotify.dll
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1817)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1083)
at net.functionseven.divicantus.Divicantus.main(Divicantus.java:24)
I'm at a loss to what is happening.
Most likely cause is that second system is missing some dlls that jahspotify.dll requires. You can check which dlls are required with Dependency Walker (http://www.dependencywalker.com/) and try manually putting these alongside jahspotify.dll. Commonly missing DLLs are from c++ redistributable packages and such.

Java Module Issues

Hey I am making a game in java using slick and run into all these errors. It works on my friend's computer but not on mine. I've tried on both mac and pc.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1119)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.<clinit>(Sys.java:112)
at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
at Game.start(Game.java:37)
at Main.main(Main.java:5)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
What does above exception mean??
I do have it in my class path.
The error message explains it all, you dont have a LWJGL on your classpath. You need to install it so as to get it working on your system.
Also you need to point the jvm to the location where the native files are located using a command line parameter -Djava.library.path="path/to/natives". JarSplice is an alternative to this
You may check this for details
The lwgjl native library cannot be found and loaded. Set the path to the folder where lwjgl.dll (if on Windows, on Mac probably liblwjgl.so) is located, with -D, for instance
java -Djava.library.path=C:\Java\ljwgl\libs com.mypackage.MyProgram
The library files must have a permission to be executed. Some computers may be configured to suppress any execution from USB stick so check.
If still does not work, try to call System.load(String fullFilePath) from your code, pointing to the location where the file clearly exists. If this works at the end, you can use this function to load library without name alterations and path assumptions. If does not, it may be wrong achitecture (64 vs 32 bit, permission problems (not executable) or the library file is just broken.

JavaCV-OpenCV error

I want to capture my webcam on a easy way into Java.
I followed this tutorial with JavaCV and OpenCV: http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/opencv-javacv-eclipse-project.html
I get this error when trying some example code:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Francis\AppData\Local\Temp\jniopencv_core7109340164936655704.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:403)
at com.googlecode.javacpp.Loader.load(Loader.java:342)
at com.googlecode.javacpp.Loader.load(Loader.java:316)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.googlecode.javacpp.Loader.load(Loader.java:335)
at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:96)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.googlecode.javacpp.Loader.load(Loader.java:335)
at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:91)
at com.googlecode.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:171)
at beeldherkenningp1.CaptureImage.captureFrame(CaptureImage.java:13)
at beeldherkenningp1.BeeldherkenningP1.main(BeeldherkenningP1.java:37)
But al my jar's are included, Microsoft Visual C++ 2010 Redistributable Package is installed, extracted OpenCV into root and my system Path is set correct... (tryed already several times to reinstal the Visual C++ Redistributable Package). (x64 bit, does it matter Netbeans is x86?)
Or does anybody know an other lib that easily captures a cam in java?
Thanks a lot!
I am the one who wrote the tutorial that you're following.
Exception in thread "main" java.lang.UnsatisfiedLinkError:
C:\Users\Francis\AppData\Local\Temp\jniopencv_core7109340164936655704.dll:
Can't find dependent libraries
It looks like the dll library is not in environment variable path because you didn't properly added the path of opencv. Or this might be issue because you have installed both x64 and x86 version of thet Visual C++ redistribuables that Romain is saying.
I suggest you to follow the steps I described here JavaCV : eclipse project configuration windows ? and Add the following to System Path ?
Configure path
64-bit version of the JDK:
[installation path]\build\common\tbb\intel64\vc10\;C:\opencv\build\x64\vc10\bin\;
32-bit version of the JDK:
[installation path]\build\common\tbb\ia32\vc10\;C:\opencv\build\x86\vc10\bin\;
Here [installation path] might be "C:\opencv"
Hope this helps.
UPDATE:
An easier and simpler step to configure JavaCV is available. Please check the link below:
http://ganeshtiwaridotcomdotnp.blogspot.com/2017/01/javacv-configuration-in-windows.html

Categories