UnsatisfiedLinkError: no jcef in java.library.path

Having problems with building or using the JCEF Java binding? Ask your questions here.

UnsatisfiedLinkError: no jcef in java.library.path

Postby Ludy » Thu Nov 10, 2016 5:14 am

Hey guys,

I'm new to jcef and I tried to make this guide(https://bitbucket.org/chromiumembedded/java-cef/wiki/BranchesAndBuilding). the build ran without any error. I tried to run the simple application "MainFrame.java", but it throws an error. The steps I made:
- create an project in Eclipse
- copied the MainFrame file
- added the jar files to the library

That is the error i get:

Code: Select all
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jcef 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 org.cef.CefApp.<init>(CefApp.java:157)
   at org.cef.CefApp.getInstance(CefApp.java:246)
   at org.cef.CefApp.getInstance(CefApp.java:233)
   at test.MainFrame.<init>(MainFrame.java:71)
   at test.MainFrame.main(MainFrame.java:154)


What am I doing wrong or have I forgotten to do something?
Ludy
Techie
 
Posts: 12
Joined: Thu Nov 10, 2016 4:48 am

Re: UnsatisfiedLinkError: no jcef in java.library.path

Postby magreenblatt » Thu Nov 10, 2016 11:00 am

You also need binary files. Try creating a binary distribution by running the make_distrib.[bat|sh] script and then look at the resulting directory structure.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: UnsatisfiedLinkError: no jcef in java.library.path

Postby Ludy » Mon Nov 14, 2016 8:45 am

thanks for your reply.

I need to build the Release configuration for the binary files, how can I build it?
Ludy
Techie
 
Posts: 12
Joined: Thu Nov 10, 2016 4:48 am

Re: UnsatisfiedLinkError: no jcef in java.library.path

Postby magreenblatt » Mon Nov 14, 2016 9:58 am

Ludy wrote:thanks for your reply.

I need to build the Release configuration for the binary files, how can I build it?

What OS are you using?
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: UnsatisfiedLinkError: no jcef in java.library.path

Postby Ludy » Mon Nov 14, 2016 10:06 am

windows 10
Ludy
Techie
 
Posts: 12
Joined: Thu Nov 10, 2016 4:48 am

Re: UnsatisfiedLinkError: no jcef in java.library.path

Postby magreenblatt » Mon Nov 14, 2016 10:21 am

In Visual Studio select "Release" configuration from the Build > Configuration manager dialog.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: UnsatisfiedLinkError: no jcef in java.library.path

Postby Ludy » Mon Nov 14, 2016 10:51 am

Many thanks, its working now :)
Ludy
Techie
 
Posts: 12
Joined: Thu Nov 10, 2016 4:48 am

Re: UnsatisfiedLinkError: no jcef in java.library.path

Postby xringxie » Fri Dec 30, 2016 5:43 am

Hi @magreenblatt, I'm using Mac and also meet same issue.

In the Release or after in the binary_distrib/macosx64, I can open the browser with simple/MainFrame.java. Does this means build from Xcode success?

But when I try to run from an IDE, I got
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jcef in java.library.path, if I ran with `java -Djava.library.path=/some_path/java-cef/src/jcef_build/native/Release`, I got something like:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /some_path/java-cef/src/jcef_build/native/Release/libjcef.dylib: dlopen(/some_path/java-cef/src/jcef_build/native/Release/libjcef.dylib, 1): Library not loaded: @rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework
Referenced from: /some_path/java-cef/src/jcef_build/native/Release/libjcef.dylib
Reason: image not found

could you please help on it? Thanks!
xringxie
Newbie
 
Posts: 1
Joined: Fri Dec 30, 2016 5:34 am

Re: UnsatisfiedLinkError: no jcef in java.library.path

Postby magreenblatt » Mon Jan 09, 2017 12:41 pm

JCEF currently requires a properly structured app bundle, so you cannot run it from an IDE outside of the app bundle.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: UnsatisfiedLinkError: no jcef in java.library.path

Postby bilaliqbal » Sat Jun 27, 2020 5:36 am

Hi @magreenblatt, I'm using Mac and also meet same issue.

In the Release or after in the binary_distrib/macosx64, I can open the browser with simple/MainFrame.java. Does this means build from Xcode success?

But when I try to run from an IDE, I got
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jcef in java.library.path, if I ran with `java -Djava.library.path=/some_path/java-cef/src/jcef_build/native/Release`, I got something like:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /some_path/java-cef/src/jcef_build/native/Release/libjcef.dylib: dlopen(/some_path/java-cef/src/jcef_build/native/Release/libjcef.dylib, 1): Library not loaded: @rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework
Referenced from: /some_path/java-cef/src/jcef_build/native/Release/libjcef.dylib
Reason: image not found

could you please help on it? Thanks!
bilaliqbal
Newbie
 
Posts: 1
Joined: Fri Jun 26, 2020 8:12 am

Next

Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 20 guests