1

I want to export my LibGDX game, but when I try to run packr with this config:

{
"platform": "windows",
"jdk": "openjdk-1.7.0-u45-unofficial-icedtea-2.4.3-windows-i586-image.zip",
"executable": "LibGDX",
"appjar": "LibGDX5.jar",
"mainclass": "cz/vilix/main/Desktop",
"vmargs": [
   "-Xmx1G"
],
"resources": [

],
"minimizejre": "soft",
"outdir": "out"
}

I get this output in the console:

Console output

But everything seems to be in place:

Required files

And I get the following output in the 'out' directory (obviously, running the 42KB exe file doesn't work):

Out folder

This is the content of the .jar file:

Content of jar

I think it might not be working due to not specifying res folder, but I don't know to fix it.

UPDATE:

I've tried creating a new xml file pom.xml, which contains this:

<dependency>
    <groupId>com.badlogicgames.packr</groupId>
    <artifactlId>packr</artifactlId>
    <version>1.1</version>
</dependency>

changed the config.json to contain this:

"resources": [
    "pom.xml"
],

The output folder looks the same, except there is the pom.xml file included. And also now I get this error:

New error

noone
  • 19,520
  • 5
  • 61
  • 76
Vilda
  • 1,675
  • 1
  • 20
  • 50
  • It wasn't mentioned in the guide. I have no idea what it is. – Vilda May 18 '14 at 09:37
  • Rather use packr-1.3-SNAPSHOT-jar-with-dependencies.jar, you can use mine: https://svn.code.sf.net/p/tuer/code/pre_beta/lib/ant/packr-1.3-SNAPSHOT-jar-with-dependencies.jar – gouessej Nov 30 '14 at 22:12

1 Answers1

2

There are many issues..

The slf4j library would come from the Maven dependecy from the pom.xml

The pom.xml would look like

<dependency>
  <groupId>com.badlogicgames.packr</groupId>
  <artifactlId>packr</artifactlId>
  <version>1.1</version>
</dependency>

If you look at the Packr Readme you notice that you specificy the pom.xml either when calling the JAR or set as a config

java -jar packr.jar .... -resources pom.xml ...

or in config.json

{

  ...
  ...

  "resources": ["pom.xml"],

  ...
}

Read the readme and follow it to fix the issues https://github.com/libgdx/packr

Sully
  • 14,672
  • 5
  • 54
  • 79
  • 1
    I've read it before (and read it again now), but still have no idea why it doesn't work. – Vilda May 18 '14 at 09:58
  • First, it is looking for $RECYCLE_BIN environment variable then trying to parse the contents, but it is failing and I am not 100% sure why. But the slf4j class not found issue can be resolved if you include the pom.xml to get the required JARs with Maven. – Sully May 18 '14 at 10:02
  • Where should I include the pom.xml? – Vilda May 18 '14 at 10:08
  • That is, I believe, is just a warning about the logger. The JAR seems to continue to process. You may try to add those JARs manually to the classpath to get rid of the message. – Sully May 18 '14 at 11:37
  • How to add them manually? The output .exe file is still 42KB. – Vilda May 18 '14 at 11:38
  • add slf4j-simple-version.jar and slf4j-api-version.jar to the classpath as you run the jar. Read http://stackoverflow.com/questions/7421612/slf4j-failed-to-load-class-org-slf4j-impl-staticloggerbinder to figure out the version check the depedencies of packr 1.1 in maven – Sully May 18 '14 at 11:43
  • In maven there's only version 1.0 I think – noone May 18 '14 at 11:46
  • How should I add them into classpath? I am sorry, I am not familiar with this. – Vilda May 18 '14 at 11:48
  • Check https://github.com/libgdx/packr/blob/master/pom.xml for other questions search here if you cant find a similar question post a new one. There are many classpath questions here. Start with Packr to see if you can do it there if not check -classpath – Sully May 18 '14 at 11:51