Improve error message for when py5 is unable to properly add its own jars
Reference:
https://github.com/py5coding/py5generator/issues/605#issuecomment-2676998006
py5 needs to add its jars to the classpath. When using pyinstaller, the jar files need to be included in the install package. If they are not, the user will get this error. We can check for this exception here and output a more helpful error.
When using pyinstaller, the jar files need to be included in the install package.
What if we'd prefer py5 to use the system's own JDK from $JAVA_HOME instead?
When using pyinstaller, the jar files need to be included in the install package.
What if we'd prefer py5 to use the system's own JDK from $JAVA_HOME instead?
Sure, that's fine. You don't have to package up the JDK or JRE with pyinstaller if you know your end users will have it already and you know that jpype will be able to find it on their machines.
You always need to include the jars though. py5 won't be able to run if the jars in the Python package are missing.
You always need to include the jars though. py5 won't be able to run if the jars in the Python package are missing.
I'm confused w/ your last statements... Will "jpype" be able to recognize Java via system variable $JAVA_HOME?
You always need to include the jars though. py5 won't be able to run if the jars in the Python package are missing.
I'm confused w/ your last statements... Will "jpype" be able to recognize Java via system variable $JAVA_HOME?
Yes, it will do that. py5's Jars are not stored at $JAVA_HOME though, they are in a directory inside the Python module. py5 needs to explicitly add them to the JVM's classpath before starting the JVM. If pyinstaller is misconfigured, it will give JPype the wrong path and the Jars will not be properly added to the classpath.
Fixed with #649