packr TestApp build wont run

675 Views Asked by At

(Windows 8.1)

This is how I build the .exe:

Go here, https://github.com/libgdx/packr

Download packr, and the .zip. I compile the TestApp source code with "javac -sourcepath $SRC -d $BIN".

the class file is now in bin>com>badlogicgames>packr I go to bin, create manifest.txt read "Main-Class: com.badlogicgames.packr.TestApp "

I create the jar: jar -cvmf manifest.txt testapp.jar com The jar is created and runs fine.

I move the jar to main folder I am working from which contains packr.jar and config.json

config.json

{
    "platform": "windows",
    "jdk": "C:/dev/resources/OpenJDK/openjdk-1.7.0-u60-unofficial-windows-i586-image.zip",
    "executable": "testapp",
    "appjar": "C:/dev/testapp/testapp.jar",
    "mainclass": "com/badlogicgames/packr/TestApp",
    "vmargs": [
        "-Xmx1G"
    ],
    "minimizejre": "soft",
    "outdir": "build"
}

Resources is optional according to the documentation so I chose not to use it. I have tried with resources and the resource folder and pom.xml in the correct place with that section in the config file but it gets the same result (running the exe does nothing)

Run packr "java -jar packr.jar config.json"

I get the warning "SLF4J: Failed to load class 'org.slf4j.impl.StaticLoggerBinder'"

But the process continues and an exe is created. I have seen on this thread:

Packr not working

Which supposedly fixes this warning (haven't tried yet, it seems fairly complicated because I am not sure where exactly I am suppose to add to the classpath the specified .jars (answerer says when running 'the jar' but which jar he is talking about i cannot say))

But he says it's "just a warning" and it seems pretty irrelevant so I'm not sure that's the reason the .exe is not running.

That would be my first question, is this warning why the .exe wont run?

If not, what is the problem here? Should I be using the pom.xml and resource folder?

Also in that question, a user called " gouessej " suggests a packr jar with included dependancies, which when I download and use creates an exe that actually starts as a process for a few seconds. The program still doesn't run correctly though.

If I could have someone spell it out for me very clearly, what I have to do to get this .exe working, I would very much appreciate it.

1

There are 1 best solutions below

0
On

Documentation in https://github.com/libgdx/packr says that attribute mainClass should be resolved class name with "." delimiting the package names. So, replace the "/" by "." in "mainclass": "com/badlogicgames/packr/TestApp"