Code Monkey home page Code Monkey logo

packr's Issues

target to mac failed to load/find main class

hello,

I have simple config file:

{
"platform": "mac",
"jdk": "/Users/piotrek/Documents/dev/packr/openjdk-1.7.0-u80-unofficial-macosx-x86_64-image.zip",
"executable": "myapp",
"classpath": [
"desktop-1.0.jar"
],
"mainclass": "pl/edu/piotrekuczy/desktop/DesktopLauncher",
"vmargs": [
"-Xmx1G"
],
"minimizejre": "soft",
"outdir": "out-mac"
}

and after all myapp can't find a mainclass:

Exception in thread "main" java.lang.NoClassDefFoundError: IllegalName: pl/edu/piotrekuczy/desktop/DesktopLauncher
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:655)
at java.lang.ClassLoader.defineClass(ClassLoader.java:794)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error: failed to load/find main class pl/edu/piotrekuczy/desktop/DesktopLauncher
logout

what is wrong?

Missing msvcp110.dll and msvcr110.dll on Windows.

The generated .exe launcher produce an errors about missing msvcp110.dll and msvcr110.dll on some Windows installations. I think it is better to avoid such dependencies. There are two ways to solve it, First - put both files in the application folder.

Second (a better alternative in my opinion) is to link the launcher statically with them. The latter is achieved by using /MD key in Configuration Properties > C/C++ > Code Generation > Runtime Library according to:
http://stackoverflow.com/questions/21103532/msvcp110-dll-how-do-i-get-around-it

I'm using the latter one and it works with no problems. The reason I have not prepared a PR is that an icon is important in .exe. And to get the icon one should compile the .exe on it's own and do not use auto generated launcher.

Mac OS X: X11 installation is required to start app

The freshly built Mac OS X app starts (Max OS X 10.9.5) lead to:

  • terminal window is opened
  • the message "X11 installation required. Install?" appears on the screen.

Is X11 really required to start java app? Or it is a kind of bug? Just not sure that the users will do it to run a small game.

Some ambiguity with vmargs in config.jason

I am having problem with showing splash screen using exe generated with packr. I tried changing config.jason to include vmargs, but no luck.
This is my Folder Structure

G:/packr/out_windows
---jre
---simphy.jar
---jogamp-fat.jar
---commons-net-3.4.jar
---splash.png
---simphy.exe
---config.jason

Application shows splash screen, when I run through command prompt with this command
javaw -Xmx1G -splash:splash.png -classpath simphy.jar;jogamp-fat.jar;commons-net-3.4.jar org.shikhar.simphy.Sandbox

but when application is invoked through packr generated exe, no splashscreen is shown(although application runs properly). This is my config.jason

{
  "classPath": [
    "Simphy.jar",
    "jogamp-fat.jar",
    "commons-net-3.4.jar"
  ],
  "mainClass": "org.shikhar.simphy.Sandbox", 
  "vmArgs": [
    "splash:splash.png",
    "Xmx1G"
    ]
}


The content of simphy.jar(which contains main class) is as shown

simphy.jar
---META-INF
---org
---splash.png

and this is content of META-INF in simphy.jar

Manifest-Version: 1.0
Main-Class: org.shikhar.simphy.Sandbox

linux segfault on startup

Looks similar to #21, but that is for Mac

I'm packing with this shell script:

#!/bin/bash

ZIPFILE="openjdk-1.7.0-u45-unofficial-icedtea-2.4.3-linux-amd64-image.zip"
#ZIPFILE="openjdk-1.6.0.zip"

java -jar packr.jar \
     -platform linux64 \
     -jdk "$ZIPFILE" \
     -executable superior-tactics \
     -appjar desktop.jar \
     -mainclass "org/jrenner/superior/desktop/DesktopStarter" \
     -vmargs "-Xmx1G" \
     -outdir packed


     #-minimizejre "soft" \

and I am using this jar file: desktop.jar

After packing, I can run "(packed directory)/jre/bin/java -jar desktop.jar" and it runs fine. But the native executable spits out a segfault when used.

jrenner@pc:~/packr/packed$ ./superior-tactics 
config file: /home/jrenner/packr/packed/config.json
jar: /home/jrenner/packr/packed/desktop.jar
mainClass: org/jrenner/superior/desktop/DesktopStarter
vmArg 0: -Xmx1G
jre: /home/jrenner/packr/packed/jre/lib/amd64/server/libjvm.so
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f5d75745284, pid=7547, tid=140039404279680
#
# JRE version: OpenJDK Runtime Environment (7.0-b31) (build 1.7.0-u45-unofficial-b31)
# Java VM: OpenJDK 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x5fc284]  get_method_id(JNIEnv_*, _jclass*, char const*, char const*, bool, Thread*)+0x84

packr with OpenJDK for Java 1.8

Hey! I've been reading about how to deploy my project, but I can't figure out how to bundle it with an jre. I've looked at packr and read the README.md, and it gives this link:
https://github.com/alexkasko/openjdk-unofficial-builds

However, that project is discontinued. I can't figure out how to make my own builds to use for my own proejcts. Can someone point me in the right direction?

Thanks.

Problem on mac. NullPointerException

Hello!

I'm trying to create a application on a mac machine. This is my json script:

{
"platform": "mac",
"executable": "ElModConfig",
"appjar": "ElModConfig.jar",
"mainclass": "eu/elmod/elmodconfig/main/MainFrame",
"outdir": "out.mac"
}

I don't want to add a sdk explicitly, the application should use the installed one (works with jar bundler).
The output when calling java -jar packr.jar mac.json is:

Exception in thread "main" java.lang.NullPointerException
at com.badlogicgames.packr.Packr.main(Packr.java:319)

any idea?

Thanks!
Thomas

Implement file associations on OS X

Since OS X has its own, non standard way of managing file associations, it would be nice if the launcher could capture the file open events and turn them into regular command line arguments.

Does this work with JRE 8 ?

Sorry, it might be a stupid question, but I see you need to bundle a zip file with JRE which is downloaded from link you provided, but there is only 7 jre, not 8 does this mean that if my app is built using 8 there is not way to create executable using packr?

Error code [126]:

Hello,

Im getting "Error code [126]:" when running my jar with the windows32 generated .exe (jre1.8.0_92). I have tested it with the windows64 generated .exe, and manually running the jar with the copied JRE (and checked that is a 32 bits JRE) and works fine.

Testing on latest version of windows 10. Any help or hint would be welcome.

The OSX app got can't open

I got
"you can't open the application because powerpc applications are no longer supported"
How can I do?

Segfault 11 on startup

I'm trying to create a test application using packr, but when I try to launch the app it crashes out with a segmentation fault 11. I tried it with the bit.ly linked packr.jar and with a freshly built from the git repo.

This is the json file:
{
"platform": "mac",
"jdk": "openjdk-1.7.0-u60-unofficial-macosx-x86_64-image.zip",
"executable": "test-packr",
"appjar": "dist/test-packr.jar",
"mainclass": "test/packr/TestPackr",
"vmargs": [
"-Xmx1G"
],
"outdir": "mac-test-packr.app"
}

This is the crash report:

Process: launchd [958]
Path: /Users/USER/*/mac-test-packr.app/Contents/MacOS/test-packr
Identifier: com.yourcompany.identifier
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: launchd [223]

Date/Time: 2014-07-16 10:15:11.561 -0400
OS Version: Mac OS X 10.7.5 (11G63)
Report Version: 9

Interval Since Last Report: 195531 sec
Crashes Since Last Report: 25
Per-App Crashes Since Last Report: 11

Crashed Thread: Unknown

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00007fff5fc01028

Backtrace not available

Unknown thread crashed with X86 Thread State (64-bit):
rax: 0x0000000000000055 rbx: 0x0000000000000000 rcx: 0x0000000000000000 rdx: 0x0000000000000000
rdi: 0x0000000000000000 rsi: 0x0000000000000000 rbp: 0x0000000000000000 rsp: 0x0000000000000000
r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000000
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
rip: 0x00007fff5fc01028 rfl: 0x0000000000010203 cr2: 0x00007fff5fc01028
Logical CPU: 2

Binary images description not available

External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 1
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 5194
thread_create: 1
thread_set_state: 0

Model: MacBookPro10,1, BootROM MBP101.00EE.B02, 4 processors, Intel Core i7, 2.6 GHz, 16 GB, SMC 2.3f36
Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB
Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In, 512 MB
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (5.106.198.19.22)
Bluetooth: Version 4.0.8f17, 2 service, 18 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM512E, 500.28 GB
USB Device: hub_device, 0x8087 (Intel Corporation), 0x0024, 0x1a100000 / 2
USB Device: FaceTime HD Camera (Built-in), apple_vendor_id, 0x8510, 0x1a110000 / 3
USB Device: hub_device, 0x8087 (Intel Corporation), 0x0024, 0x1d100000 / 2
USB Device: hub_device, 0x0424 (SMSC), 0x2512, 0x1d180000 / 3
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0262, 0x1d182000 / 5
USB Device: BRCM20702 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0x1d181000 / 4
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8286, 0x1d181300 / 7

Java version on OS X 10.6.8

I'm looking for a good strategy to solve a problem with customers not able to start the game on OS X 10.6.8.

User issue here:
http://community.playstarbound.com/index.php?threads/crash-at-startup-mac.83079/

With the help of Google looking for "EXC_BREAKPOINT _forwarding_ + 673" I found some hints that OS X 10.6.8 and lower might have issues with anything newer than JRE 1.7.0 u25, a version which I can't even find for download anymore.

Example:
http://forums.poxnora.desertowlgames.com/index.php?threads/mac-troubleshooting.1338/#post-13271

Right now I see a few approaches:

  • Let packr try to detect somehow that it's running on <= 10.6.8, then try to load the system JRE. No idea yet if this works (means I didn't try it yet).
  • Bump the minimum requirements to OS X 10.7, ask users to upgrade if possible. This wouldn't get us much love from customers who already bought it.
  • Leave it as it is for our game, point users to try running the .jar directly. Not very convenient.

Embedded JVM not used

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

DEB Installation Package Suggestion

Just as a suggestion, but for Linux (or more precisely anything Debian based like Ubuntu) maybe one could also choose between zip and deb packing. Deb package files are very common for most Linux distributions, and definitely most that gamers are going to use (mainly Ubuntu).

Again, just a suggestion. I may try to work on this myself as well.

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException

When trying to run on Mac OS X (El Capitan) it errors out with the exception

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 15
    at com.badlogicgames.packr.Packr.parseArgs(Packr.java:429)
    at com.badlogicgames.packr.Packr.main(Packr.java:314)

The following is what I'm executing to package my application.

java -jar ~/Downloads/packr.jar -platform-mac -jdk "https://bitbucket.org/alexkasko/openjdk-unofficial-builds/downloads/openjdk-1.7.0-u80-unofficial-macosx-x86_64-bundle.zip" -executable foo -classpath ["dist/frankenjar.jar"] -mainclass "JarMain" -vmargs "-Xmx1G" -minimizejre "soft" -outdir ./exe/

JavaFX's Application class cannot find the main class, despite being invoked from the former.

The executable shuts off the JVM as soon as Application.launch(args) from JavaFX is ran. Test message was placed directly after the invocation and was not displayed on the console.

    public static void main(String[] args) {
        System.out.print("test0");
        initRuntime();

        String devCheck = System.getenv("tailor-dev-mode");
        if (devCheck != null && devCheck.equalsIgnoreCase("true")) {
            LaunchOptions options = new LaunchOptions(true);

            log.info("Running in development mode!");
            launchGame(options);
            return;
        }

        System.out.println("test1");
        Application.launch(args);
        System.out.println("test2"); // never shown
    }
Loading JVM runtime library ...
Passing VM options ...
  # -Xms512M
  # -Xmx1536M
Creating Java VM ...
Passing command line arguments ...
Loading JAR file ...
Invoking static me.scarlet.undertailor.desktop.DesktopLauncher.main() function ...
test0test1
Destroyed Java VM ...
Press ENTER key to exit.

Built using a 64bit Oracle JRE, unminified for the purpose of testing.

IOException with macosx and jar minification

get this trace:

Unpacking JRE
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
copying resources
minimizing JRE
unpacking rt.jar
packing rt.jar
Exception in thread "main" org.zeroturnaround.zip.ZipException: java.io.IOException: File out-linux64/myjar.jar.tmp/META-INF/license exists and is not a directory. Unable to create directory.
        at org.zeroturnaround.zip.ZipUtil.rethrow(ZipUtil.java:2556)
        at org.zeroturnaround.zip.ZipUtil.iterate(ZipUtil.java:379)
        at org.zeroturnaround.zip.ZipUtil.unpack(ZipUtil.java:704)
        at org.zeroturnaround.zip.ZipUtil.unpack(ZipUtil.java:689)
        at com.badlogicgames.packr.Packr.minimizeJre(Packr.java:216)
        at com.badlogicgames.packr.Packr.pack(Packr.java:157)
        at com.badlogicgames.packr.Packr.main(Packr.java:345)
Caused by: java.io.IOException: File out-linux64/myjar.jar.tmp/META-INF/license exists and is not a directory. Unable to create directory.
        at org.apache.commons.io.FileUtils.forceMkdir(FileUtils.java:1482)
        at org.zeroturnaround.zip.ZipUtil$Unpacker.process(ZipUtil.java:822)
        at org.zeroturnaround.zip.ZipUtil.iterate(ZipUtil.java:368)
{
    "platform": "linux64",
    "jdk": "/Users/mori/jres/openjdk-1.7.0-u80-unofficial-linux-amd64-installer.zip",
    "executable": "myjar",
    "appjar": "myjar.jar",
    "mainclass": "com.moribellamy.Main",
    "vmargs": [
       "-Xmx1G"
    ],
    "resources": [
    ],
    "minimizejre": "soft",
    "outdir": "out-linux64"
}

Oddly, i dont have this problem when i don't use jar minification on mac. When I run on ubuntu, I can use minification and the whole thing works.

App doesn't run with correct "working dir" on Mac OSX

I have this setup in content/Mac OS/:

myjar.jar
jre/
assets/
etc.

When I double click the generated .app it doesn't find the files located in the assets/ folder. However if I execute the native executable in Mac OS/ directly from terminal it works as expected. So it seems the "working dir" is not set correctly when opening the application normally.

Love you Mario!

Using the current directory as -outdir causes all files in it to be deleted

I ran with this command line

java -jar packr-1.1-SNAPSHOT-jar-with-dependencies.jar -platform windows -jdk openjdk-1.6.0-unofficial-b30-windows-amd64-image.zip -executable blade -mainclass com.example.App -appjar target\App.jar -outdir .

I got

Exception in thread "main" java.io.IOException: Unable to delete file: .\packr-1.1-SNAPSHOT-jar-with-dependencies.jar
    at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1390)
    at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
    at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:977)
    at com.badlogicgames.packr.Packr.pack(Packr.java:56)
    at com.badlogicgames.packr.Packr.main(Packr.java:274)

and the working tree was deleted.

It would be good if deleting an existing directory triggered a confirmation.

Various minimizejre profiles?

Current minimizeJre() function has fixed set of jre/* standalone files and rt.jar (java runtime lib) packages to be removed. Cmd line argument minimizejre=true/false boolean does not give much choice to fine tune different profiles.

Should minimizejre cmdline be string and then later can introduce two or more minimizing profiles?
minimizejre=none | default | high | medium | minimum | lwjglapp | xyzframeworkapp | ...
Use current values true->default and false->none keeping compatibility or drop them.

Run via Gradle

So, I'm currently porting my LibGDX project over to Gradle. Would it be possible to run this small but awesome tool via Gradle on the Buildserver? Possibly as a desktop:distJRE task or something like that. The alternative would obviously be to just run the command, but I thought that maybe there is a better way of doing this.

Antialiasing on Mac Retina

When creating an application on a retina Mac, some kind of antialiasing is used. The text is blurry in comparison with the jar run natively (java -jar myapp.jar)
bildschirmfoto 2015-04-09 um 10 25 49
bildschirmfoto 2015-04-09 um 10 25 20

Not compatible with Capsule.io jars but with Workaround

Summary: packr appears to extract/recompress the Capsule fat jar in the classPath and it no longer loads. Replacing the generated output jar with the original will return the Capsule functionality and the generated native executable is able to run it.

Tested environment:

  • Windows 10 Enterprise x86_65
  • Java 8u101 x86_64
  • Latest downloaded Packr.jar
  • Latest capsule-maven (from sg.enixsoft)

My current build process has Capsule build a fat jar to include all dependencies including the signed BouncyCastle provider. When I use packr on this jar file, it appears to modify the capsule.jar such that it no longer runs with java -jar name_of_capsule.jar . Here are the steps to recreate with a known good capsule.jar file (in this example ecc-tester-java-0.1-SNAPSHOT-capsule.jar)

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
Cleaning output directory 'D:\work\shoon\temp\installer\output' ...
Copying executable ... 
Copying classpath(s) ...
Unpacking JRE ...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Removing foreign platform libs ...
  # Unpacking 'jar\ecc-tester-java-0.1-SNAPSHOT-capsule.jar' ...
  # Repacking 'jar\ecc-tester-java-0.1-SNAPSHOT-capsule.jar' ...
  #3076 kb -> 3076 kb
Done!

Changing into the output directly, run the generated exe. Since there is no console log on windows send to log (native.exe > log) and see that it exits immediatly after invoking the Capsule class:

Loading JVM runtime library ...
Passing VM options ...
  # -Xmx1G
Creating Java VM ...
Passing command line arguments ...
Loading JAR file ...
Invoking static Capsule.main() function ...

Attempt to run the output jar file exhibits the same behavior - it simply exits

java -jar ecc-tester-java-0.1-SNAPSHOT-capsule.jar

Now I replaced that jar file with the original/source capsule jar to do a sanity check

 java -jar ecc-tester-java-0.1-SNAPSHOT-capsule.jar
...APPLICATION LOG STARTS HERE

Now that the jar is working again, retest the generated exe (but still no console output, have to send to a log (native.exe > log))

java -jar ecc-tester-java-0.1-SNAPSHOT-capsule.jar
Loading JVM runtime library ...
Passing VM options ...
  # -Xmx1G
Creating Java VM ...
Passing command line arguments ...
Loading JAR file ...
Invoking static Capsule.main() function ...
...APPLICATION LOG STARTS HERE

Final note: The original capsule jar file and the packr output jar file have binary diffs but extracting them (using 7zip) shows no internal differences.

Minimizing error

Hi guys:

I'm receiving this error message using openjdk-1.7.0-u60-unofficial-windows-i586-image.zip with soft profile:

Unpacking JRE
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further detail
s.
copying resources
minimizing JRE
unpacking rt.jar
Exception in thread "main" java.io.FileNotFoundException: File does not exist: o
ut4\jre\lib\rt\com\sun\corba \se
        at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1386)
        at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
        at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:977)
        at com.badlogicgames.packr.Packr.minimizeJre(Packr.java:194)
        at com.badlogicgames.packr.Packr.pack(Packr.java:153)
        at com.badlogicgames.packr.Packr.main(Packr.java:302)

I'm receiving another error message using openjdk-1.7.0-u60-unofficial-windows-i586-image.zip with hard profile:

Unpacking JRE
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further detail
s.
copying resources
minimizing JRE
unpacking rt.jar
Exception in thread "main" java.io.FileNotFoundException: File does not exist: o
ut4\jre\lib\rt\com\sun\jndi \url
        at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1386)
        at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
        at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:977)
        at com.badlogicgames.packr.Packr.minimizeJre(Packr.java:194)
        at com.badlogicgames.packr.Packr.pack(Packr.java:153)
        at com.badlogicgames.packr.Packr.main(Packr.java:302)

Without minimizing I don't receive any error. Have I to use another jdk/jre?

Best regards!

Can't deploy libGDX game

I use Android studio. When I run the game from the Ide, I works fine.

I used this link to deploy jar file: https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline#packaging-the-project
Used gradlew desktop:dist command. jar deployed succesfully.

When I double click on the jar file, window opens but closes back immediately. But when I open a command window and run java -jar myapp.jar, it works fine.

Then I used Packr tool. Here is a link: https://github.com/libgdx/packr I used this command:
java -jar packr.jar -platform windows32 -jdk "openjdk-1.7.0-u80-unofficial-windows-i586-image.zip" -executable AutumnDark -classpath desktop-1.0.jar -mainclass "com.nightlybuild.digital.autumnlake.one.desktop.DesktopLauncher" -minimizejre "soft" -outdir outwin -vmargs "-Xmx1G" -resources assets
I have my assets in assets folder. Also they were packed into the original jar file.

It works fine, but gives an warning, something like logger not found. Which is not mandotary, I think.

Inside outwin folder, everything looks fine. There are .exe, .jar, config.json, jre folder, and assets folder with all the assets.

When I run the jar from command file like below game works. Still cannot double click on it.

When I run exe by double clickingon it, the game starts. Everything runs normal until (I am just guessing, I used game.exe > o.txt in the command prompt to deduce this from output) game tries to read an asset/file. Then without error, output says this Destroyed Java VM .... I don't have any experience with the Packr tool.

Troubleshooting: I am using win10 tried compatibility mode and administrator mode. Nothing is read only. Tried with -vmargs "-Xmx1G" and without. Tried with -resources assets and without. Game runs perfectly if I run the jar with console.

Thanks in advance.

If any other information is necessary, please ask me.

App won't open on OS X Mavericks

I packed a simple "hello world" application for OS X and it runs on my development machine fine. However, on a machine with a fresh install of Mavericks, where there is no JVM, the app does not run, instead I get a dialog prompting me to install Java 6:

mavericks

Packr command was as follows:

java -jar packr-1.1-SNAPSHOT-jar-with-dependencies.jar
  -platform mac
  -jdk "openjdk-1.7.0-u45-unofficial-icedtea-2.4.3-macosx-x86_64-image.zip"
  -executable hello 
  -appjar gui.jar
  -mainclass "com/example/gui/HelloWorld"
  -minimizejre true
  -outdir out.app

Cannot code sign for Mac App Store

The packager unfortunately puts all the java files INTO the Mac OS folder. As a result, the game will not properly code sign.

Would it be possible to ask for ability to move everything except the Mac OS executable to the Resources folder? The game will not code sign with config.json and the jre folder inside the Mac OS folder.

conf-mac2.json.txt

Too aggressive minimizejre: Breaks Gdx.app.getPreferences

Problem happens only with minimizejre: true.

Used JRE: openjdk-1.7.0-u40-unofficial-windows-i586-image.zip

Application throws exception

    javax.xml.parsers.FactoryConfigurationError: Provider com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl not found
            at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:127)
            at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:92)
            at java.util.XMLUtils.load(XMLUtils.java:74)
            at java.util.Properties.loadFromXML(Properties.java:868)
            at com.badlogic.gdx.backends.lwjgl.LwjglPreferences.<init>(LwjglPreferences.java:51)
            at com.badlogic.gdx.backends.lwjgl.LwjglPreferences.<init>(LwjglPreferences.java:41)
            at com.badlogic.gdx.backends.lwjgl.LwjglApplication.getPreferences(LwjglApplication.java:307)
            at com.redacted.w.data.DataStorage.<init>(DataStorage.java:35)
            at com.redacted.w.MainApp.create(MainApp.java:132)
            at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
            at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
    Caused by: java.lang.ClassNotFoundException: com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:270)
            at javax.xml.parsers.FactoryFinder.getProviderClass(FactoryFinder.java:123)
            at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:178)
            at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:147)
            at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:265)
            at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:121)
            ... 10 more

on accessing preferences by using Gdx.app.getPreferences("name")

Userful comment from @tommyettinger on IRC:

<TEttinger> comment out this line and I think that should enable the dependencies of prefs.  it may need others
<TEttinger> https://github.com/libgdx/packr/blob/master/src/main/java/com/badlogicgames/packr/Packr.java#L189

The file permissions aren't preserved when unzipping and copying the JRE

I tried to use Packr both with a JRE on my local file system and by passing a URL. Just before the decompression, in both cases, all files in jre/bin are executable. Just after the decompression, in {out}/Contents/MacOS/tmp, you can see that those files are no longer executable as ZipUtil.unpack() does nothing to preserve file permissions:
https://github.com/zeroturnaround/zt-zip/blob/master/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L915

Fine-tuning for a few string operations

I find that a few string operations can be optimised in the function "launchVM".

  • How do you think about to assign the result of the expression "execDir + std::string("/config.json")" to a variable?
  • Would it be a bit more efficient to append data to the variable "execDir" instead of using the additional "jarFile"?

Java VM long argument prevents .exe from start under windows

UTF-8 encoding must be explicitly specified under Windows. I.e. argument "-Dfile.encoding=UTF-8" must be used to start JVM. Otherwise all non ascii strings becomes corrupted in the game. It is true for official JRE 7, as well as for unofficial JRE 7.

So the game is started with corrupting russian letters by the .exe after packing. The game could be successfully started with correct letters by manually executing:

jre\bin\java.exe -jar -Dfile.encoding=UTF-8 desktop.jar

However .exe is not working when one includes "-Dfile.encoding=UTF-8" argument in config. I.e. the .exe just does nothing (now errors, no game start) with the following config:

{
   "jar": "desktop.jar",
   "mainClass": "com/mmxgames/ttj/desktop/Launcher",
   "vmArgs": [
      "-Xmx1G",
      "-Dfile.encoding=UTF-8"
   ]
}

I was experimenting and found this happens if the argument exceeds 14 characters. So it starts with argument "-Dfile.encodin" but does not start with argument ""-Dfile.encoding" (of corse the argument itself does not work).

Exe created by packr flagged as virus

We use packr to generate an .exe for our game. However, this Windows exe gets flagged as malware by a fairly wide range of virus scanners.

Here is the complete report:
https://www.virustotal.com/en/file/528b2fe72c5e478ed5212b2f0b04e98275a7d626fb046076407f8b90be0d857c/analysis/1466068465/

Did anyone else experience this issue? Am I right to suspect it has nothing to do with our actual application (as the exe does not contain any of our actual code)? Not sure how to prevent this.

Packr-generated exe prints nothing, does nothing

I'm unsure what's causing this, but after running Packr with the command line

java -jar packr.jar -platform windows -jdk "C:/Users/user/.lein-packr-cache/windows.zip" -executable perlin -appjar "target/perlin-0.0.1-SNAPSHOT-standalone.jar" -mainclass "perlin/core/desktop_launcher" -minimizejre "hard" -resources resources -outdir out-win32

it successfully generates an exe in the directory out-win32. Running this exe in the Windows 7 64-bit command prompt with no args causes nothing to be printed, and it immediately closes. Double clicking the exe causes the cursor on Windows 7 to show the spinning circle next to it for a few seconds, but opens no windows. What could cause this?

The JDK I'm using is from the recommended unofficial builds project (zip file link). I can run the jar with java -jar perlin-0.0.1-SNAPSHOT-standalone.jar and it displays a libgdx window and renders some perlin noise. This problem with the packed output happens whether -minimizejre is set or not, and I suspect it may be related to finding the main class, or to the structure of the unofficial build zips changing. The demo is written in Clojure using the play-clj binding to libgdx, and I was able to run Packr 1.0 on Clojure apps before, so I suspect something broke in the meanwhile. I tried this with the latest Packr link available in the Readme, and programatically with the 1.2 version on Maven Central (more on that in a bit). I did modify the soft and hard profiles as I mentioned in a comment on #18 . The non-working exe and working jar are bundled here, with a jre from Packr, so you can inspect it more closely.

I am also trying to make a plugin for the Clojure build tool called Leiningen, so it can use Packr to bundle JREs as part of a build step. My code for this plugin (which is in Clojure, but very small right now) is available on my Github. Generating anything programatically suffered the same fate as running Packr manually.

I'm at a loss for what to do here. The output it generates is totally normal:

Unpacking JRE
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
copying resources
minimizing JRE
unpacking rt.jar
packing rt.jar
Done!

But of course, it generates an exe that doesn't do anything. Does anyone have an idea what could be wrong, and whether it's on my side or a bug with Packr?

Allow packr without JRE

Would really like a way to package an application that uses the system JRE instead of packing a minimized version. This way I can instead require users to have Java installed and reduce the size of my application.

Add ARM support

For a project I was working on I thought it might be useful to utilize the packr launcher but there isn't an ARM build (or more specifically, a Raspberry Pi build).

I'm not sure the proper way of going about this, but I was able to get an ARM version built by doing the following:

  1. Removing the platforms directive (platforms { "x32", "x64" }) located at the end of the premake4-linux.lua file
  2. Edit the launcher.cpp file and change the jre assignment
    • From: std::string jre = execDir + std::string("/jre/lib/i386/server/libjvm.so");
    • To: std::string jre = execDir + std::string("/jre/lib/arm/client/libjvm.so");

With these changes I was able to compile it natively on the Raspberry Pi. I imagine this isn't the proper way to do this as I'm not using any defines, etc, but it worked so I figure it might be helpful and it would be much appreciated to see ARM support officially added to Packr.

Thank you!

It doesn't show gui on windows 10 -> Issue with dependencies

I can't get it to work now, I used to deploy this way last year and now I can not, maybe I am doing something wrong anyway.

My program runs, but the gui won't show up. It runs in background and I can see the process in the task manager and it even creates some folders so it is running, but nothing on screen. If I click on the .jar file it works perfect.

Last thing I did was to build latest fork from @code-disaster ( v2 sqash ), redownloaded openjdk and even updated .json files according to that specific fork branch, and same thing:

See a picture of my config
http://i.imgur.com/kGaZyzZ.png
(i also tried windows32 with the corresponding openjdk, version 45 and also version 80)
Thanks

Windows 64bit support

Maybe my search skills are inexistent, but I can't find any issue about this.

Why there isn't any Windows 64bit version? I saw that @code-disaster submitted a build script that compiled it, but then removed it on a commit titled Oops...

Is there something missing to support this?

[193] %1 is not a valid Win32 application.

Using a locally-built version of packr at commit 08a74d4, since you guys don't seem to update the main download link. This seems to break SLF4J logging during building.

The program compiles fine, but the executable does nothing other than provide me with the title message.

Loading JVM runtime library ...
Error code [193]: %1 is not a valid Win32 application.
Error: failed to load VM runtime library!

Using OpenJDK 1.8.0_91-3 from https://github.com/ojdkbuild/ojdkbuild as the bundled JRE on a Windows 7 x64 system, although the same occurs when using an official Oracle JRE.

java -jar packr.jar --platform "windows32" --jdk "C:\Users\Xemiru\Desktop\packr\jre\win32-1.8.0_91.zip" --output "build-win32" -- config.json
@PAUSE
{
    "platform": "windows32",
    "executable": "undertailor",
    "classpath": [
        "undertailor.jar"
    ],
    "mainclass": "me.scarlet.undertailor.desktop.DesktopLauncher",
    "vmargs": ["Xms512M", "Xmx1536M"],
    "minimizejre": "oraclejre8",
    "jdk": "jre/win32-1.8.0_91.zip",
    "output": "build-win32",
    "verbose": true
}

Configuration options above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.