Build problem on Ubuntu

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

Build problem on Ubuntu

Postby TheHammer » Tue Oct 27, 2015 10:27 am

For some JavaFX work I have Java 8 installed. I understand that JCEF isn't yet working with Java 8 so I also installed java 7. Both installs are sitting in /usr/lib/jvm as
java-8-oracle and java-7-oracle and I'm able to swtich between them using

Code: Select all
sudo update-alternatives --config java


switching to Java 7 and calling java -version I do get
Code: Select all
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)


However that did not seem to change the JAVA_HOME variable and so when executing

Code: Select all
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug


I get
Code: Select all
-- Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) (Required is at least version "1.7")
CMake Error at CMakeLists.txt:208 (message):
  A Java installation is required.  Set the JAVA_HOME environment variable to
  explicitly specify the Java installation directory.


So I set JAVA_HOME in /etc/environment so the line looks like this
Code: Select all
JAVA_HOME="/usr/lib/java-*"

I also tried
Code: Select all
JAVA_HOME="/usr/lib/java-7-oracle"


if I source it and then echo $JAVA_HOME it gives me that path but I still get the same error. What is it going to take to get this setup so I can start actually working with it? I've done more troubleshooting just rrying to get JCEF to build than I have developing.
TheHammer
Newbie
 
Posts: 7
Joined: Mon Oct 26, 2015 1:08 pm

Re: Build problem on Ubuntu

Postby magreenblatt » Tue Oct 27, 2015 11:44 am

Try removing the jcef_build directory, re-creating it and re-running CMake after setting the JAVA_HOME variable. You might also need to set the variable using export for CMake to pick it up:

Code: Select all
export JAVA_HOME=/usr/lib/java-7-oracle
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: Build problem on Ubuntu

Postby TheHammer » Tue Oct 27, 2015 12:27 pm

I noticed that the instructions say to create that directory and then enter it, but the list file can't be found if you do that. I assume it's to be run out of that dir?
TheHammer
Newbie
 
Posts: 7
Joined: Mon Oct 26, 2015 1:08 pm

Re: Build problem on Ubuntu

Postby magreenblatt » Tue Oct 27, 2015 12:32 pm

TheHammer wrote:I noticed that the instructions say to create that directory and then enter it, but the list file can't be found if you do that. I assume it's to be run out of that dir?

You need the '..' at the end of the cmake command. See the BranchesAndBuilding Wiki page.
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: Build problem on Ubuntu

Postby TheHammer » Tue Oct 27, 2015 12:39 pm

magreenblatt wrote:
TheHammer wrote:I noticed that the instructions say to create that directory and then enter it, but the list file can't be found if you do that. I assume it's to be run out of that dir?

You need the '..' at the end of the cmake command. See the BranchesAndBuilding Wiki page.


Ah I see. Did that. Got the same error that it can't find Java. Even tried it on a fresh install of 15.04 VM with openJDK instead. exported the path as you described.
TheHammer
Newbie
 
Posts: 7
Joined: Mon Oct 26, 2015 1:08 pm

Re: Build problem on Ubuntu

Postby TheHammer » Tue Oct 27, 2015 12:49 pm

TheHammer
Newbie
 
Posts: 7
Joined: Mon Oct 26, 2015 1:08 pm

Re: Build problem on Ubuntu

Postby TheHammer » Tue Oct 27, 2015 1:01 pm

The following however DOES work
Code: Select all
cmake -G "Unix Makefiles" -DJAVA_HOME=/usr/lib/jvm/java-7-oracle -DCMAKE_BUILD_TYPE=Debug ..


cmake is picking it up from the arguments not the variables.
TheHammer
Newbie
 
Posts: 7
Joined: Mon Oct 26, 2015 1:08 pm

Re: Build problem on Ubuntu

Postby TheHammer » Tue Oct 27, 2015 1:58 pm

I'm about ready to give this up. I've spent an entire very valuable day doing this. Even from a clean Ubuntu 15.04 install from scratch, following all of the directions to the letter on the JCEF site and now I have a compile error.

Code: Select all
/home/chris/projects/JCEF/src/native/CefApp.cpp:23:22: fatal error: gdk/gdkx.h: No such file or directory
compilation terminated.



I have libgtk2.0-dev installed and I tried numerous other libraries and quite a bit of Google searching to try to resolve this. I'm afraid
Currently supported distributions include Debian Wheezy, Ubuntu Precise, and related. Newer versions will likely also work but may not have been tested. Required packages include: build-essential, libgtk2.0-dev.
doesn't come close to what is needed.

Disappointing because this was supposed to be a demonstrator app for my employer for embedding CEF but I may have to go with JavaFX which doesn't have the same message passing between HTML and host and not as good a version of webkit. Or I learn C++ well enough real damn quick.
TheHammer
Newbie
 
Posts: 7
Joined: Mon Oct 26, 2015 1:08 pm

Re: Build problem on Ubuntu

Postby magreenblatt » Tue Oct 27, 2015 10:20 pm

Unfortunately it's not possible for me to test JCEF on every distro and version of Linux. I use Ubuntu 14.04 LTS 64-bit and it works for me. Maybe you should start with Windows or OS X where the development environment is more homogenious.
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: Build problem on Ubuntu

Postby everflux » Wed Nov 04, 2015 11:09 am

For me, using Ubuntu 15.10, the following packages were required: cmake, libgtk2.0-dev and build essential.

Code: Select all
sudo apt-get install cmake libgtk2.0-dev build-essential


The main problem was that and old version of libgcrypt, libgcrypt11 was needed as well... I installed it manually:

Code: Select all
wget https://launchpad.net/ubuntu/+archive/primary/+files/libgcrypt11_1.5.3-2ubuntu4.2_amd64.deb
sudo dpkg -i libgcrypt*
everflux
Newbie
 
Posts: 3
Joined: Wed Nov 04, 2015 10:46 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 17 guests