JPro-one / JPro

The right place to report about bugs or suggest improvements for JPro.
https://www.jpro.one
9 stars 4 forks source link

JPro Windows bundle cannot find path #129

Open BlueGoliath opened 2 years ago

BlueGoliath commented 2 years ago

Attempting to run a JPro bundle generated via the Maven plugin on Windows results in an error:

"The system cannot find the path specified."

and terminated. The application can be run using JPro via an IDE on either Windows or Linux or via a bundle generated on Linux.

Tested on version 2022.1.2.

FlorianKirmaier commented 2 years ago

Thank you for opening the ticket. we will definitely need more details to help you.

You mean you try to run the zip, created with mvn jpro:release on a windows machine?

My first guess would be, that your JAVA_HOME is not set properly. Is your JAVA_HOME set? If JAVA_HOME is not set, then JPro falls back to the java command, but if the JAVA_HOME variable just is wrong, then this does not happen.

And can you reproduce this problem when bundling our Maven Hello World project? https://github.com/JPro-one/HelloJPro-Maven

BlueGoliath commented 2 years ago

JAVA_HOME is not set. Is there a way to get JPro to use the JLink bundle generated by the JavaFX plugin and use that?

FlorianKirmaier commented 2 years ago

Not really - currently JPro uses the JVM from the JAVA_HOME/PATH. It might be an idea for the future, to allow bundling the JPro release with a java runtime. It also gets a bit tricky - because it needs a version for every OS. Is there are problem with setting the JAVA_HOME?

BlueGoliath commented 2 years ago

Would it? The JLink distro would come from the JRE being used by Maven/IDE. It shouldn't be any different than what JPro does now, I would think.

Normally setting JAVA_HOME wouldn't be a problem, but I need to use built from source JDK builds. If the idea is that the bundle can be extracted on any Windows computer and "just work" then it's not going to work.

The recommended way to package Java applications past Java 9 is JLink as well.

FlorianKirmaier commented 2 years ago

Currently, mvn jpro:releases creates a release which can work on different OSs. Do you know, whether it can create a Windows JRE on Mac or on Linux? (And the other way around)

Otherwise we would lose the option to create cross-platform builds. Which is especially problematic, because when jpro is deployed, the OS of the "deploying device" is oftern differant as the server.

But in general i aggree, that this would be the goto solution.

What you could also do, is add another JRE to the jproRelease zip, and your own start-scripts (which configure JAVA_HOME with your jre).

BlueGoliath commented 2 years ago

Besides translation layers like Wine, no, not that I know of.

But I'm not sure if that's an issue. JPro doesn't need to tie itself to any platform JRE/JDK, it needs to provide the option to be bundled with one in the build tool config. A JLink bundle is just a cut-down JDK with all modular project dependencies inside it*. JPro doesn't have to exclusively use it any more than JavaFX's plugin currently does.

*Technically possible to use JLink without all dependencies being modules but it requires slightly more work. Not relevant to JavaFX's plugin though.

The biggest issue I see is if JPro requires JDK modules that aren't included in the JavaFX bundle. Maybe it's possible to execute the JavaFX plugin and modify the list of modules to include? No idea.