JCEF initialization issue on MacOS - java

My Java app which uses JCEF, works perfectly fine in Windows Operating System. But when I try to run this sample application on MacOS Mojave, then it's facing initialization issues. I have added the desired jars and JCEF MacOS libraries/binaries into my project, also added JVM parameter to startup configuration as:
-Djava.library.path=*/jcef/jcef_build/native/Release,
but at the time of running application im facing the folowing error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /jcef_build/native/Release/libjcef.dylib: dlopen(*/jcef_build/native/Release/libjcef.dylib, 1): Library not loaded: #rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework
Referenced from: */jcef_build/native/Release/libjcef.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.cef.CefApp.<init>(CefApp.java:149)
at org.cef.CefApp.getInstance(CefApp.java:237)
at org.cef.CefApp.getInstance(CefApp.java:224)
at MainFrame.<init>(MainFrame.java:70)
at MainFrame.main(MainFrame.java:145)
Please any one suggest what I am missing in running this sample application.

Related

Setting up LibPostal (JPostal) on Windows in Java

I'm trying to setup libpostal/jpostal on my Windows 10 machine in a Java environment. I followed the Windows Installation Guide on GitHub.
I am able to see the libpostal folder installed under: C:\xxx\Program Files\libpostal\ with sub folders: .git, autom4te.cache, data, m4, resources etc.
However, when I run:
AddressExpander expander = AddressExpander.getInstance();
I get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpostal_expander 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 com.mapzen.jpostal.AddressExpander.<clinit>(AddressExpander.java:7)
at jpostal.JPostal.execute(JPostal.java:24)
at global_projects.GlobalMain.main(GlobalMain.java:37)
I normally use Maven for my build. However, since there is currently no Maven repository for JPostal, I am using Gradle.
I followed the solution suggested on this GitHub thread by adding the following gradle.build file, however I still get the same error.
What am I doing wrong?

Tess4J 4.0.0 java.lang.UnsatisfiedLinkError: The specified module could not be found

Downloading and using tessData-best for tesseract-ocr github repository improved my accuracy for english on Tess4j 3.8.4 significantly. But to use that trainedData for other languages i had to upgrade to Tess4J 4.0.0. But When I did that its giving me following error on this line
TessBaseAPI api = TessAPI1.TessBaseAPICreate();
Exception in thread "main" java.lang.UnsatisfiedLinkError: The specified module could not be found.
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.Native.open(Native.java:1759)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:260)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
at com.sun.jna.Native.register(Native.java:1396)
at com.sun.jna.Native.register(Native.java:1156)
at net.sourceforge.tess4j.TessAPI1.<clinit>(TessAPI1.java:41)
at OCR.confidenceWord(OCR.java:106)
at OCR.processImg(OCR.java:381)
at test.main(test.java:10)
I have 64-bit windows 8.1 running on my machine with 64-bit JVM. I have VC++ 2015 redistributable installed. I checked in dependency walker and no dll seems to be missing.By setting system property "jna.debug.load" to "true", I can see it properly looks for and gets "libtesseract400" at temp folder. Has anyone been able to solve this error?

OpenGL Error with Executable .JAR (Architecture Word Mismatch?)

I've created an OpenGL-based application using Java, JOGL and Maven. I'm using Arch Linux for ARM on a 32-bit machine. When I build the project from within my development environment, the application loads and executes successfully.
When I use maven-assembly-plugin to generate a JAR which houses both my compiled application code and all of it's dependencies, the executable JAR terminates before it's able to establish an OpenGL context, with an error I've never seen before:
Java HotSpot(TM) Server VM warning: You have loaded library /tmp/jogamp_0000/file_cache/jln5003285820939498405/jln7050454496148437271/libgluegen-rt.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/jogamp_0000/file_cache/jln5003285820939498405/jln7050454496148437271/libgluegen-rt.so: /tmp/jogamp_0000/file_cache/jln5003285820939498405/jln7050454496148437271/libgluegen-rt.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:575)
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:95)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:459)
at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:421)
at com.jogamp.common.os.Platform$1.run(Platform.java:317)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.common.os.Platform.<clinit>(Platform.java:287)
at com.jogamp.opengl.GLProfile.<clinit>(GLProfile.java:146)
at com.jogamp.opengl.util.AnimatorBase.<clinit>(AnimatorBase.java:112)
at com.app.main(Main.java:123)
Do you have any idea what could be the issue? One thing that might be worth mentioning is that I use emulated graphics on this machine, so I depend upon software rasterization.

How to connect JPL with SWI-Prolog in Mac OS X

Hi i have a problem with a jpl interface. I want connect JPL with swi-prolog installed with mac-ports with eclipse. I have a jpl.jar and i have tried to import the jar file in eclipse with build path but i have this error: "no jpl in java.library.path".
So i have copied libjpl.dylib in a /opt/local/lib/swipl-7.1.29/bin/ and when i execute the code i have this error: "Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/local/lib/swipl-7.1.29/bin/libjpl.dylib: dlopen(/opt/local/lib/swipl-7.1.29/bin/libjpl.dylib, 1): Library not loaded: /Users/janw/stable/lib/swipl/lib/x86_64-darwin13.0.0/libswipl.dylib
Referenced from: /opt/local/lib/swipl-7.1.29/bin/libjpl.dylib
Reason: image not found"
After a anoying waste of time i found the solution about that problem.
First of all, its completely necesary to install swi-prolog via macports, if not, as i did, when you point in the
Djava.library.path=/users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0
this exception will apear
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib: dlopen(/Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib, 1): Library not loaded: /Users/janw/stable/lib/swipl/lib/x86_64-darwin13.0.0/libswipl.dylib
Referenced from: /Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at jpl.JPL.loadNativeLibrary(JPL.java:100)
at jpl.fli.Prolog.<clinit>(Prolog.java:85)
at jpl.Query.open(Query.java:286)
at jpl.Util.textToTerm(Util.java:162)
at jpl.Query.<init>(Query.java:198)
at consultasProlog.Consultas.consultaFicheroProlog(Consultas.java:19)
at utilidades.RellenarModelo.ejecutarArchivo(RellenarModelo.java:30)
at javaprolog.JavaProlog.main(JavaProlog.java:30)
Java Result: 1
So follow these steps.
port install swi-prolog on terminal , if you dont have install already macports command not found will apear so go to https://www.macports.org/install.php and install macports.
navigate to the path of swi prolog macports installation which mine is
/opt/local/lib/swipl-6.6.6/lib/x86_64-darwin14.0.0
copy this path and set in java.library.path in the java VM as -Djava.library.path=/opt/local/lib/swipl-6.6.6/lib/x86_64-darwin14.0.0
Now .pl with jpl.jar will be able to execute and the consults will run.
Hope it will help you and every person who find this hell problem.
Cheers frank.

Cannot run Xuggler on linux

I have a problem running Xuggler on linux:
08:43:05.550 [main] WARN com.xuggle.ferry.JNILibrary - Failure: library load of library: xuggle; url: /tmp/xuggle/xuggle2624685369771797713.tmp; error: java.lang.UnsatisfiedLinkError: /tmp/xuggle/xuggle2624685369771797713.tmp: /tmp/xuggle/xuggle2624685369771797713.tmp: failed to map segment from shared object: Operation not permitted
08:43:05.565 [main] ERROR com.xuggle.ferry.JNILibraryLoader - Could not load library: xuggle; version: 5; Visit http://www.xuggle.com/xuggler/faq/ to find common solutions to this problem
Exception in thread "main" java.lang.UnsatisfiedLinkError: no xuggle in java.library.path
Same JAR works fine on Windows.
I tried to include xuggler-5.4.jar, 5.2.jar, I also tried to make maven project and to compile with maven, the problem persists.
Here is the CLASSPATH, so you can see I also included lately in the classpath the jar
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.25.x86_64//jre/lib/ext:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.25.x86_64//lib/tools.jar:/home/baidoc/libs/xuggle-xuggler-5.4.jar

Categories

Resources