Java initialization delay until needed

I have a webpage where I sometimes need to communicate with the device. This device is accessed using sockets, so I have a jar file with support libraries.

When you want to receive data from the device, you press the button, and the javascript method retrieves the data using the library (there is no java code)

The presence of jar causes the java machine to start as soon as you load the page.

Since there are many users who do not use this option (as a rule, they don’t even have a device, for starters), they see this as a nuisance.

Is there any way to delay loading java until a button is clicked?

I do not want to redirect them to another page, this should be done on the same page.

+4
source share
2 answers

You can load the jar file into a separate div created dynamically via javascript at the time you need it.

+4
source

If you want to consider downloading your application using java-webstart technology, you can implement a button similar to what oracle has on its page here

Basically, what the button does is download the necessary banks specified in the jnlp file and launch it.

0
source

Source: https://habr.com/ru/post/1468906/


All Articles