Hi,
I am trying to use JWebBrowser, but I am getting the following error:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: chrriis/dj/nativeswing/swtimpl/components/JWebBrowser
at net.nbirn.mbat.plugins.registration.WebBrowser.layoutPanel(WebBrowser.java:75)
...
Could you please help me?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi Christopher,
Thanks for reply. I added the all appropriate jar files, but the JWebBrowser has only JWebBrowser(NSOption... options) constructor, however in your example code you are initializing JWebBrowser with JWebBrowser() constructor which is not mentioned in the class summary. It works in your code, but for me it gives a constructor error. Could you please explain how you make it work?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I may be wrong but this looks a lot like a basic Java error: the DJ Native Swing JAR files are missing from your classpath.
You need to add DJNativeSwing.jar, DJNativeSwing-SWT.jar and some of the JARs in the lib folder depending on the features you use (the SWT JAR is mandatory, the JNA JARs are generally needed).
Hope this helps,
-Christopher
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After adding all necessary JAR files i'm still getting this error on eclipse.
Erreur : impossible d'initialiser la classe principale Test.GMaps
Causé par : java.lang.NoClassDefFoundError: chrriis/dj/nativeswing/swtimpl/components/JWebBrowser
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think you have the relevant JAR files in your classpath. You need:
- NativeSwing.jar
- NativeSwing-SWT.jar
- The SWT library conforming to your platform (64 bit, Windows, etc.)
Hope this helps,
-Christopher
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It works know, i have one more question : when navigate on sites JWebBrowser asks me to update compatible browser, and after i update the browsers i have , i'm still getting the same thing .
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
On Windows, the default web browser engine is Internet Explorer which is now deprecated. If you use a recent version of the SWT library and if you use the latest preview of DJ Native Swing, you can force the use of the Edge runtime either by passing "JWebBrowser.useEdgeRuntime()" to the JWebBrowser constructor or using the system property "nativeswing.webbrowser.runtime=edge". That being said, the Edge runtime does not allow all the API of the JWebBrowser but it works well to view websites.
Hope this helps,
-Christopher
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd like to display google maps in panel on my java swing project, the first second the map appears and after that this windows ( the attatched picture ) appears and the maps disappears .. i still get the same problem after updating my browsers and setting microsoft edge the default browser.
As I indicated in my last post, you need to force the use of the Edge runtime on Windows. This can be done using a system property. Perhaps the problem is that you are not using the lastest preview version, older (and official) version did not support Edge.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to use JWebBrowser, but I am getting the following error:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: chrriis/dj/nativeswing/swtimpl/components/JWebBrowser
at net.nbirn.mbat.plugins.registration.WebBrowser.layoutPanel(WebBrowser.java:75)
...
Could you please help me?
Thanks
hi Christopher,
Thanks for reply. I added the all appropriate jar files, but the JWebBrowser has only JWebBrowser(NSOption... options) constructor, however in your example code you are initializing JWebBrowser with JWebBrowser() constructor which is not mentioned in the class summary. It works in your code, but for me it gives a constructor error. Could you please explain how you make it work?
Thanks
> JWebBrowser(NSOption... options)
This is a vararg, a Java 5 feature. The project is to be used with a Java 5 or later JRE.
-Christopher
Hi,
I may be wrong but this looks a lot like a basic Java error: the DJ Native Swing JAR files are missing from your classpath.
You need to add DJNativeSwing.jar, DJNativeSwing-SWT.jar and some of the JARs in the lib folder depending on the features you use (the SWT JAR is mandatory, the JNA JARs are generally needed).
Hope this helps,
-Christopher
hi Christopher,
After adding all necessary JAR files i'm still getting this error on eclipse.
Erreur : impossible d'initialiser la classe principale Test.GMaps
Causé par : java.lang.NoClassDefFoundError: chrriis/dj/nativeswing/swtimpl/components/JWebBrowser
Thanks
Hi,
I don't think you have the relevant JAR files in your classpath. You need:
- NativeSwing.jar
- NativeSwing-SWT.jar
- The SWT library conforming to your platform (64 bit, Windows, etc.)
Hope this helps,
-Christopher
thank you Christopher,
It works know, i have one more question : when navigate on sites JWebBrowser asks me to update compatible browser, and after i update the browsers i have , i'm still getting the same thing .
On Windows, the default web browser engine is Internet Explorer which is now deprecated. If you use a recent version of the SWT library and if you use the latest preview of DJ Native Swing, you can force the use of the Edge runtime either by passing "JWebBrowser.useEdgeRuntime()" to the JWebBrowser constructor or using the system property "nativeswing.webbrowser.runtime=edge". That being said, the Edge runtime does not allow all the API of the JWebBrowser but it works well to view websites.
Hope this helps,
-Christopher
hi Christopher,
I'd like to display google maps in panel on my java swing project, the first second the map appears and after that this windows ( the attatched picture ) appears and the maps disappears .. i still get the same problem after updating my browsers and setting microsoft edge the default browser.
Thanks
As I indicated in my last post, you need to force the use of the Edge runtime on Windows. This can be done using a system property. Perhaps the problem is that you are not using the lastest preview version, older (and official) version did not support Edge.