Closed lorenberg closed 3 years ago
What version of packr do you use exactly? The 1.6 installation prompt would have been an issue which was supposed to be fixed with #40.
Hello,
actually this is not the error I am getting......I am not sure how I can check the packr version I am using, but I downloaded the one following the link the github project home page (linking to bit.ly/packrgdx). The problem is that when I start the launcher with a double click on OSx (after renaming the output folder with a .app), it simply ignores the embedded openjdk. For the moment, I used a workaround by creating an executable bash script and using it to start the embedded JVM, but it would be nice to be able to avoid this extra step. As I told, I am not getting the missing JRE installation, but this seems to be something different. And, by the way, I tried to use packr to create also the windows distribution with the .exe file, but in this case the .exe do nothing. I am using Launch4J as an alternative to create the .exe package, but having only one tool (and I would like to have packr which I think easier to reuse) would be better.
This is my config.json file, if needed
{ "platform": "mac", "jdk": "openjdk-1.7.0-u45-unofficial-icedtea-2.4.3-macosx-x86_64-image.zip", "executable": "Launcher", "appjar": "myJarFile.jar", "mainclass": "main_package/Main", "vmargs": [ "-Xmx1G" ], "outdir": "out" }
Thanks again, let me know if I can help you with some other information. BTW, I am forced to use the u45 JDK because using the u80 I got the X11 installation prompt.
Sorry, a small correction for my previous post concerning windows: I forgot that only 32 bits is supported, so the code not executing that I was reporting before was the 64 bits..... Windows 32 bits works perfectly without any problem. Still open the question on OSx, on the other hand :)
Try to run from a terminal and check the output.
first
open ./YourBundle.app
then
./YourBundle.app/Contents/MacOS/Launcher
If everything is set up right, both of them should work actually. Maybe the terminal output can give you some hints.
Hi,
actually I already did this test, and the output was the following SEVERE: null javax.script.ScriptException: Exception in thread "main" java.lang.UnsupportedClassVersionError: firmware_updater/Firmware_Updater : Unsupported major.minor version 51.at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.lang.ClassLoader.loadClass(ClassLoader.java:247)ava:301) at apple.applescript.AppleScriptEngine.evalScript(Native Method) at apple.applescript.AppleScriptEngine.eval(AppleScriptEngine.java:368) at apple.applescript.AppleScriptEngine.eval(AppleScriptEngine.java:339) at firmware_updater.OSx_Main.main(OSx_Main.java:53)
So, I realized just now that the problem is simply that the AppleScriptEngine is not supported for the JVM version I am bundling! In fact, if I remove the call to that class (that I am actually needing because I need my program to run with root privileges......), the programs starts fine!
So, the problem is not with Packr, luckily :)))
This takes me to another question then......is there any way for Packr to require administrator privileges for running the application? Otherwise I should stick with my current solution......
Thanks again
Hi again,
I was able to fix also this last problem by simply compiling my application with JVM 1.6 as a target :). Anyhow, I would be curious to know if with packr you can specify to run an application with administrator privileges or not, and how can I recompile the native libraries you placed in (the xcode project missing stuff I was telling you before).
Thanks for the great work and for the indirect help in fixing the issue ;)
Admin privileges: I don't know, never worked with them. "Unsupported major.minor version 51" actually means that the JRE tried to load, but does not understand Java 7 byte code.
Native compile: you say it complains about a missing Xcode project after running ./build-mac.sh? This could mean that premake4 isn't available/installed, or hasn't been found.
I'm not sure if I should create a new issue for this but I'm noticing the packed JRE is not being used in my testing.... the system JRE is always being called on systems that have a java environment and environments without a JRE simply do not run.
Environment:
Here's my packr config:
java -jar packr.jar --platform windows64 --jdk jre\winx86_64\jdk1.8.0_101.zip --executable ecc_test_packr --mainclass Capsule --classpath jar\ecc-tester-java-0.1-SNAPSHOT-capsule.jar --output output --vmargs Xmx1G --verbose
When I run the packr executable on a machine without a JRE, I get the following output
Loading JVM runtime library ...
When I run the packr executable on a machine with a JRE (but without the JCE) it runs but my main application detects the JCE Unlimited policy isn't available (i.e. it's using the system JRE not the one I packr'd)
This issue is quite old, if you run into any issues with the latest version of packr please open a new issue.
Hello,
I started using your application, and I seem to have finally found the way to distribute my Java application on OSx as well, without forcing users to install a whole JVM. I am currently facing only a (hopefully) last problem, which I am sure you can help me fixing. The problem happens only on MACOSx. I embedded the openjdk 1.7_u45_x86-64_OSx in my application, and I am currently able to fully run my application from command line (using a bash script similar to the one suggested in a previous discussion). Actually, I am stucked because of the following problem:
1 - if I call the script from Info.plist (set as Executable file), the application is not able to start, actually it seems to completely ignore the embedded JVM and it tries to use the JVM 1.6 which was installed on OSx (10.10.5). When doing the same thing on 10.11 El Capitan, I am prompted for installing the JRE
2 - I wanted to try recompiling the native packr for OSx, but when I try to run the build-mac.sh script, the system complains that no Xcode project is found in the specified directory.
So, actually my questions are the following:
1 - can you help me understanding why the script works fine when launched from command line, while it fails when double clicking on the .app?
2 - can you tell me what I should do to recompile the packr_mac with the suggested modification?
Thank you very much,
Lorenzo