Jump to content
Excelsior Forums
doanchu

Problem with JXBrowser

Recommended Posts

Running this sample program

import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserType;
import com.teamdev.jxbrowser.chromium.Callback;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;
import com.teamdev.jxbrowser.chromium.swing.internal.LightWeightWidget;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.RenderedImage;
import java.io.File;

/**
* The sample demonstrates how to get screen shot of the web page
* and save it as PNG image file.
*/
public class HTMLToImageSample {
   public static void main(String[] args) throws Exception {
       // #1 Create Browser instance
       Browser browser = new Browser(BrowserType.LIGHTWEIGHT);
       BrowserView view = new BrowserView(browser);

       // #2 Set the required view size
       browser.setSize(1280, 1024);

       // Wait until Chromium resizes view
       Thread.sleep(500);

       // #3 Load web page and wait until web page is loaded completely
       Browser.invokeAndWaitFinishLoadingMainFrame(browser, new Callback<Browser>() {
           @Override
           public void invoke(Browser browser) {
               browser.loadURL("https://teamdev.com");
           }
       });

       // Wait until Chromium renders web page content
       Thread.sleep(500);

       // #4 Get java.awt.Image of the loaded web page.
       LightWeightWidget lightWeightWidget = (LightWeightWidget) view.getComponent(0);
       Image image = lightWeightWidget.getImage();
       ImageIO.write((RenderedImage) image, "PNG", new File("teamdev.com.png"));

       // Dispose Browser instance
       browser.dispose();
   }
} 

resulted in this error:

The application has started with command line:
java -cp /Users/doanchu/Github/testjxbrowser/out/artifacts/testjxbrowser_jar/jxbrowser-6.2.jar:/Users/doanchu/Github/testjxbrowser/out/artifacts/testjxbrowser_jar/jxbrowser-mac-6.2.jar:/Users/doanchu/Github/testjxbrowser/out/artifacts/testjxbrowser_jar/testjxbrowser.jar:/Users/doanchu/Github/testjxbrowser/out/artifacts/testjxbrowser_jar/license.jar HTMLToImageSample 
---------------------------------------------------------------------------
dyld: lazy symbol binding failed: Symbol not found: _JVM_ArrayCopy
 Referenced from: /Users/doanchu/Downloads/jet11.0-eval-amd64/profile1.8.0_72/jre/lib/libosx.dylib
 Expected in: /Users/doanchu/Downloads/jet11.0-eval-amd64/profile1.8.0_72/jre/lib/jetvm/libjvm.dylib

dyld: Symbol not found: _JVM_ArrayCopy
 Referenced from: /Users/doanchu/Downloads/jet11.0-eval-amd64/profile1.8.0_72/jre/lib/libosx.dylib
 Expected in: /Users/doanchu/Downloads/jet11.0-eval-amd64/profile1.8.0_72/jre/lib/jetvm/libjvm.dylib


---------------------------------------------------------------------------
The application has terminated with exit code: 133

Could you tell me what is wrong with Excelsior JET configuration?

Update: this only happens with Excelsior Jet 11 for Mac.

Share this post


Link to post
Share on other sites

Running this sample program

...

resulted in this error:

The application has started with command line:
java -cp /Users/doanchu/Github/testjxbrowser/out/artifacts/testjxbrowser_jar/jxbrowser-6.2.jar:/Users/doanchu/Github/testjxbrowser/out/artifacts/testjxbrowser_jar/jxbrowser-mac-6.2.jar:/Users/doanchu/Github/testjxbrowser/out/artifacts/testjxbrowser_jar/testjxbrowser.jar:/Users/doanchu/Github/testjxbrowser/out/artifacts/testjxbrowser_jar/license.jar HTMLToImageSample 
---------------------------------------------------------------------------
dyld: lazy symbol binding failed: Symbol not found: _JVM_ArrayCopy
 Referenced from: /Users/doanchu/Downloads/jet11.0-eval-amd64/profile1.8.0_72/jre/lib/libosx.dylib
 Expected in: /Users/doanchu/Downloads/jet11.0-eval-amd64/profile1.8.0_72/jre/lib/jetvm/libjvm.dylib

dyld: Symbol not found: _JVM_ArrayCopy
 Referenced from: /Users/doanchu/Downloads/jet11.0-eval-amd64/profile1.8.0_72/jre/lib/libosx.dylib
 Expected in: /Users/doanchu/Downloads/jet11.0-eval-amd64/profile1.8.0_72/jre/lib/jetvm/libjvm.dylib


---------------------------------------------------------------------------
The application has terminated with exit code: 133

Could you tell me what is wrong with Excelsior JET configuration?

Hello,

Thank you for the provided information.

Yes, it seems this is a bug in Excelsior JET.

Please, can you tell what OS X version do you use?

Best Regards,

Ruslan Kim

Excelsior Support

Share this post


Link to post
Share on other sites

Hello,

Thank you for the provided information.

Yes, it seems this is a bug in Excelsior JET.

Please, can you tell what OS X version do you use?

Best Regards,

Ruslan Kim

Excelsior Support

Hi,

I am using OS X El Capitan. I think it is JET's bug too. This is the link for jar files for JXBrowser:

http://cloud.teamdev.com/downloads/jxbrowser/jxbrowser-6.2-cross-desktop-win_mac_linux.zip

This is the evaluation license:

https://www.teamdev.com/e/dc3d976e-1fd1-40f1-a4ab-603cc63e4a92/

The previous example runs perfectly fine on Windows.

Share this post


Link to post
Share on other sites

Hi,

I am using OS X El Capitan. I think it is JET's bug too. This is the link for jar files for JXBrowser:

http://cloud.teamdev.com/downloads/jxbrowser/jxbrowser-6.2-cross-desktop-win_mac_linux.zip

This is the evaluation license:

https://www.teamdev.com/e/dc3d976e-1fd1-40f1-a4ab-603cc63e4a92/

The previous example runs perfectly fine on Windows.

Hello,

Thank you for the provided information.

We have found the root cause of the issue and are working on the fix.

If you want to get the hotfix for the problem when it is ready, please contact us via email: java [at] excelsior-usa.com

Just write a link for this forum topic in the email message and also list for what editions you need the fix (Evaluation only or for other editions too in case you purchased a license).

Best Regards,

Ruslan Kim

Excelsior Support

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×