Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

WebView not working when packed in a JAR

se32862378Apr 7 2014 — edited Apr 22 2014

I have an application running JavaFX 8 with a WebView component using lots of Javascript (JQuery and the OpenLayers library).

It runs fine if I execute it in a terminal with the classpath pointing to the directory where the classes are. However, if I package the application in a JAR and point the classpath to such JAR instead, the web view still shows all its components, but JQuery scripts (and all the other remotely loaded scripts) apparently are not executed.

I am loading Javascript libraries with something like:

<script src="http://code.jquery.com/jquery-<version>.min.js">

</script> <script src="http://openlayers.org/api/OpenLayers.js"></script>

My guess is that the embedded webpage in the WebView component cannot load the required remote Javascript files since the application does not have internet access. Trying to solve this, I signed the app jar using:

jarsigner myjar myalias

But it is not helping. The permissions in my ~/.java.policy file looks as follows:

keystore "file:<userpath>/.keystore", "jks";

grant signedBy
"myalias" {
  permission java
.security.AllPermission;
};

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 20 2014
Added on Apr 7 2014
5 comments
2,770 views