Os X Sierra: Java compilation fails after Java update

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

Os X Sierra: Java compilation fails after Java update

Postby Kremio » Wed Apr 26, 2017 3:25 am

Hi!

I'm developing a Scala/Java/HTML5 application that uses JCEF. I'm working under Mac Os X 10.12.4

I had a properly working JCEF project until yesterday, when my application started crashing due to the class org/cef/browser/mac/CefBrowserWindowMac calling a missing symbol.
I didn't save a copy of the stack trace at runtime, but I'm copy/pasting the error message from the java compiler

Code: Select all
    [javac] /KSD/CHEF/jcef/src/java/org/cef/browser/mac/CefBrowserWindowMac.java:30: error: cannot find symbol
    [javac]           result = ((CPlatformWindow)pWindow).getNSWindowPtr();
    [javac]                                              ^
    [javac]   symbol:   method getNSWindowPtr()
    [javac]   location: class CPlatformWindow


I have recently updated the Java JDK to the latest version available from Oracle (version 1.8.0.131 at the time of writing this post). I believe that is what triggered the problem.

What I've tried:
Using previous versions of the JDK, namely 1.7.0.80 and 1.8.0.51 - Same problem

I'm confused about what other fix I could try, so I'm hoping that someone with more knowledge of Java and Mac Os X can shed some light on the issue.

Also, from my online search, it seems that no one else has reported experiencing the same issue. Could it be that the problem is specific to my setup and not related to the JDK update?

Thanks in advance!
-
Jonathan
Kremio
Newbie
 
Posts: 5
Joined: Thu Apr 20, 2017 4:23 am

Re: Os X Sierra: Java compilation fails after Java update

Postby magreenblatt » Wed Apr 26, 2017 9:31 am

Try recompiling the JCEF Java files and your application.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Os X Sierra: Java compilation fails after Java update

Postby Kremio » Thu Apr 27, 2017 2:08 am

Hi!

I've pulled the latest commit (4e31e66) from the JCEF GIT repository and did a new build. Unfortunately the JAVA compilation error persists.

I followed the procedure from the Wiki, and this is what
Code: Select all
cmake -G "Xcode" -DPROJECT_ARCH="x86_64" ..
reports :
Code: Select all
-- *** JCEF CONFIGURATION SETTINGS ***
-- Python executable:            /usr/bin/python
-- Java directory:               /Volumes/Slowee/Users/KSD/.jenv/versions/oracle64-1.8.0.131
-- JNI libraries:                /Volumes/Slowee/Users/KSD/.jenv/versions/oracle64-1.8.0.131/jre/lib/libjawt.dylib;/Volumes/Slowee/Users/KSD/.jenv/versions/oracle64-1.8.0.131/jre/lib/server/libjvm.dylib
-- JNI include directories:      /Volumes/Slowee/Users/KSD/.jenv/versions/oracle64-1.8.0.131/include;/Volumes/Slowee/Users/KSD/.jenv/versions/oracle64-1.8.0.131/include/darwin;/Volumes/Slowee/Users/KSD/.jenv/versions/oracle64-1.8.0.131/include


Then I start the build using XCode, and everything goes smoothly until the last part of the build when the JCEF Java code is being compiled:
Code: Select all
ant -buildfile /Volumes/Slowee/Users/KSD/Projects/KSD/CHEF/jcef/src -Djdk7.path=/Volumes/Slowee/Users/KSD/.jenv/versions/oracle64-1.8.0.131 -Dout.path=/Volumes/Slowee/Users/KSD/Projects/KSD/CHEF/jcef/src/jcef-build/native/Release -Dout.name=jcef_app -Dout.id=org.jcef.jcef -Dout.mainclass=tests.detailed.MainFrame bundle
Buildfile: /Volumes/Slowee/Users/KSD/Projects/KSD/CHEF/jcef/src/build.xml

compile:
    [javac] Compiling 147 source files to /Volumes/Slowee/Users/KSD/Projects/KSD/CHEF/jcef/src/jcef-build/native/Release
    [javac] /Volumes/Slowee/Users/KSD/Projects/KSD/CHEF/jcef/src/java/org/cef/browser/mac/CefBrowserWindowMac.java:30: error: cannot find symbol
    [javac]           result = ((CPlatformWindow)pWindow).getNSWindowPtr();
    [javac]                                              ^
    [javac]   symbol:   method getNSWindowPtr()
    [javac]   location: class CPlatformWindow
    [javac] 1 error


Any other ideas?

Best regards.
-
Jonathan
Kremio
Newbie
 
Posts: 5
Joined: Thu Apr 20, 2017 4:23 am

Re: Os X Sierra: Java compilation fails after Java update

Postby waicool20 » Thu Apr 27, 2017 10:30 am

Revert back to java 8u121, for some reason that method is missing in 8u131 or some older version of java, consider opening a ticket at https://bitbucket.org/chromiumembedded/java-cef/issues

After reverting I can compile using these commands no problem.
Code: Select all
# Assuming your in jcef_build directory
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4
waicool20
Newbie
 
Posts: 7
Joined: Sat Apr 22, 2017 3:40 am

Re: Os X Sierra: Java compilation fails after Java update

Postby Kremio » Fri Apr 28, 2017 3:59 am

Thanks, it worked like a charm!
It has to be noted that the JCEF App produced by the build also needs to be run using the same version of the JAVA run-time, otherwise the error will resurface at runtime.

I opened a ticket: https://bitbucket.org/chromiumembedded/java-cef/issues/270/mac-os-10124-build-fails-with-java-version

Hopefully this discussion thread will help other troubleshoot their installation.

FYI, I used the utility tool jenv ( https://github.com/gcuisinier/jenv ) to manage multiple JRE versions on Mac Os X. It was quite helpful.

Best regards.
-
Jonathan
Kremio
Newbie
 
Posts: 5
Joined: Thu Apr 20, 2017 4:23 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 13 guests