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;
};