0

My project contains a WebView with html and JS resources. When I launch my .jar file, the WebView remains blank, instead of showing a JS map.

Java Code for loading the html:

bridge  = BridgeSingleton.getInstance();
WebEngine engine = webviewmap.getEngine();
URL urlHello = getClass().getResource("/map/map.html");
engine.load(urlHello.toExternalForm());

The html and JS files are stored in "resources" folder. When the program is launched in Eclipse, it works fine, but not in .jar version.

Any idea about the issue?

18
  • does your jar contain item /map/map.html? Commented May 8, 2018 at 13:08
  • How can I verify this ? because I generated the jar file from Eclipse, so I think it should contain all necessary files. Commented May 8, 2018 at 13:09
  • Do you copy the resource folder when packaging the jar? You can open the jar in any zip application and check if everything you need is there. Commented May 8, 2018 at 13:10
  • @Pesho how can I do that ? Commented May 8, 2018 at 13:11
  • how do you export jar file? with eclipse menu, with maven etc? Commented May 8, 2018 at 13:12

1 Answer 1

0

The problem is resolved: it was an issue with the geoIp API.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.