What to include / how for a Java project

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

What to include / how for a Java project

Postby unhuman » Tue Apr 12, 2016 4:39 pm

I'm trying to set up a Java project and the sample app works just fine - it's on Mac (although I will want to deploy to Linux at some point).

My new project has the JAR and dylib files and appears to be accessing those just fine.

It however, doesn't seem to be finding a dependency (the actual Chromium Embedded Framework?). I've debugged the loading of the it and found this exception:
Code: Select all
java.lang.UnsatisfiedLinkError: /Users/XXXX/code/MyProject/com.company.project/lib/libjcef.dylib: dlopen(/Users/XXXX/code/MyProject/com.company.project/lib/libjcef.dylib, 1): Library not loaded: @executable_path/Chromium Embedded Framework
  Referenced from: /Users/XXXX/code/MyProject/com.cvcompany.project/lib/libjcef.dylib
  Reason: image not found


I haven't been able to find any instructions on actually how to package up all the things and then reference them. I did specify
Code: Select all
-Djava.library.path=/Users/XXXX/code/MyProject/com.company.project/lib/libjcef.dylib
and that did get me a little further to get the above exception.

I just don't know how to package & reference the actual CEF...

Thanks for any pointers.
unhuman
Newbie
 
Posts: 2
Joined: Tue Apr 12, 2016 4:31 pm

Re: What to include / how for a Java project

Postby magreenblatt » Wed Apr 13, 2016 2:31 am

Running from outside of an app bundle is not supported on OS X. Look at the sample jcef_app.app to understand the required structure.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: What to include / how for a Java project

Postby bkolb » Wed Apr 13, 2016 5:43 am

It might be related to https://github.com/oracle/node-oracledb/issues/231

Maybe try to run it on another OS or disable the Mac Security Feature.

Would you mind sharing your example? I am currently looking for a similar use case and could not figure out the details yet.

Thx
Bernd
bkolb
Newbie
 
Posts: 3
Joined: Mon Mar 28, 2016 1:52 pm

Re: What to include / how for a Java project

Postby unhuman » Wed Apr 13, 2016 3:23 pm

magreenblatt wrote:Running from outside of an app bundle is not supported on OS X. Look at the sample jcef_app.app to understand the required structure.


Thanks for the reply. I know Java CEF is not the same as JxBrowser, but they don't have the same restriction, although they also do not have have a freestanding native component - they deliver OS-specific JARs.

I'll play around with Linux a bit more, but our dev environment here is generally Mac and we deploy to Linux. I could set up a VM for this... I'll follow up when I get that done.

bkolb - I can't share our project, but I can describe what I've done:
  • Intellij project
  • I created a lib directory and threw all the JARs, dylib, and dependencies in there.
  • I then right click to add the JARs so intellij will resolve them (I'm not dealing with maven yet)
  • In my project settings, I set the VM options to: -Djava.library.path=lib/

Doing that, like I said, it gets all the way to the .dylib, but that's where it gets lost trying to resolve CEF.
unhuman
Newbie
 
Posts: 2
Joined: Tue Apr 12, 2016 4:31 pm

Re: What to include / how for a Java project

Postby bkolb » Thu Apr 14, 2016 5:31 am

Thx!

Have you tried to use the same approach on Linux? If it works there it is most likely related to the link I've shared. We recently experienced a similar problem when working with the z3 solver.

Bernd
bkolb
Newbie
 
Posts: 3
Joined: Mon Mar 28, 2016 1:52 pm

Re: What to include / how for a Java project

Postby jvallar » Wed Nov 30, 2016 7:53 pm

unhuman wrote:I'm trying to set up a Java project and the sample app works just fine - it's on Mac (although I will want to deploy to Linux at some point).

My new project has the JAR and dylib files and appears to be accessing those just fine.

It however, doesn't seem to be finding a dependency (the actual Chromium Embedded Framework?). I've debugged the loading of the it and found this exception:
Code: Select all
java.lang.UnsatisfiedLinkError: /Users/XXXX/code/MyProject/com.company.project/lib/libjcef.dylib: dlopen(/Users/XXXX/code/MyProject/com.company.project/lib/libjcef.dylib, 1): Library not loaded: @executable_path/Chromium Embedded Framework
  Referenced from: /Users/XXXX/code/MyProject/com.cvcompany.project/lib/libjcef.dylib
  Reason: image not found


I haven't been able to find any instructions on actually how to package up all the things and then reference them. I did specify
Code: Select all
-Djava.library.path=/Users/XXXX/code/MyProject/com.company.project/lib/libjcef.dylib
and that did get me a little further to get the above exception.

I just don't know how to package & reference the actual CEF...

Thanks for any pointers.


Did you fix it? I am having the same use case. Our app is bundle in jar and distribute thru JNLP Webstart. We are not using native bundling.
jvallar
Newbie
 
Posts: 5
Joined: Tue Nov 29, 2016 9:02 pm


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 17 guests