Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Always use embedded JRE on Windows #622

Closed
lfcnassif opened this issue Jun 23, 2021 · 10 comments
Closed

Always use embedded JRE on Windows #622

lfcnassif opened this issue Jun 23, 2021 · 10 comments
Assignees

Comments

@lfcnassif
Copy link
Member

On Windows, instead of just exiting if JavaFx is not found or warning if installed java version is not tested, we could restart the application using the windows embedded JRE.

@ronaldorcosta
Copy link

It would be useful to have a mechanism to allow the application to be started preferably with the built-in java. Something like:
IPED-Search.app.exe -java built-in

This would allow a case delivered on a fast media to be self-contained.

@lfcnassif
Copy link
Member Author

lfcnassif commented Nov 23, 2021

It would be useful to have a mechanism to allow the application to be started preferably with the built-in java. Something like:
IPED-Search.app.exe -java built-in

We use Launch4j to build the IPEDSearch.exe (basically calls iped-search-app.jar with a few options). It has a "fallback" option, where the embedded JRE can be used if the detected/installed JRE on the system does not respect a min/max version range. Currently just min version is specified and we can specify the max version. edited: Lauch4j allows to always use the embedded JRE, but I don't know if Lauch4j allows to change this behavior at runtime with a command line switch like you proposed.

@lfcnassif
Copy link
Member Author

lfcnassif commented Nov 23, 2021

PS: For others, the idea of using the installed system JRE if available and supported is because application starting is very slow if executed from some devices, such as DVD optical medias, where report cases are often delivered in. This was tested a long ago with old versions, and could be re-evaluated.

@lfcnassif
Copy link
Member Author

IPED-Search.app.exe -java built-in

Thinking better about this, if you could use a command line param, you can simply run indexador\jre\bin\java.exe -jar indexador\lib\iped-search-app.jar using a bat file, right?

@ronaldorcosta
Copy link

ronaldorcosta commented Nov 23, 2021 via email

@lfcnassif
Copy link
Member Author

IPED would invoke the built-in java or invoke the java installed on the machine?

Currently it calls installed java, but this could be changed to always use embedded or even behave differently depending on detected java version, because we have full control on this part of the code.

@lfcnassif
Copy link
Member Author

As Java 11 has removed JavaFX and it is not too easy to be installed by users, I'll change the default behavior to always use the embedded JRE on Windows from IPED-SearchApp.exe

@lfcnassif lfcnassif changed the title Use embedded JRE on Windows if user java version is not supported Always use embedded JRE on Windows Nov 25, 2021
@lfcnassif lfcnassif self-assigned this Jan 19, 2022
@lfcnassif
Copy link
Member Author

While testing #1336 I noticed opening a case from a network share became slower, as expected, since now the embedded JRE is always used.

But now with the two phase bootstrap (#1119) it would be easy to implement the original idea: check if user JRE is supported and if it has JFx. If not, warn user the slower embedded JRE will be used, suggesting to install and pointing to a JRE 11 with JFx already embedded, e.g. Liberica. Thoughts?

@wladimirleite
Copy link
Member

Using a local JRE if available/compatible would be good in this scenario. It is a bit slower using a JRE from a network (or a slow HDD) location.

@wladimirleite
Copy link
Member

Just a side note, here JRE 11 is not available in the machines, but we can try to request its installation, if IPED uses it when opening cases.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants