Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Invalid jar files after compression  (Read 1237 times)
0 Members and 1 Guest are viewing this topic.
Offline caseyd

JGO n00b
*

Posts: 9



« on: 2009-02-21 18:53:35 »

How do I compress a jar file with a manifest file and keep it executable? For example I was trying to use the following to create an executable jar:

1  
bjwflate -s 513 A.class META-INF\MANIFEST.MF


Whenever I try to run it it tells me the jar file is corrupt. This happens a lot after using certain optimizers as well. I also verified that I can create a jar file with the jar command and 7zip that runs ok.

Thanks,
Casey
Offline Hsaka

Jr. Member
**

Posts: 95
Medals: 2



« Reply #1 on: 2009-02-22 00:30:12 »

With bjwflate, cd to the directory with your class file and meta-inf folder and type

1  
bjwflate -r gameName.zip *


Then rename gameName.zip to gameName.jar
Offline EnderGT

Jr. Member
**

Posts: 98



« Reply #2 on: 2009-02-24 19:06:03 »

How do I compress a jar file with a manifest file and keep it executable? For example I was trying to use the following to create an executable jar:

1  
bjwflate -s 513 A.class META-INF\MANIFEST.MF


Whenever I try to run it it tells me the jar file is corrupt. This happens a lot after using certain optimizers as well. I also verified that I can create a jar file with the jar command and 7zip that runs ok.

Thanks,
Casey

Basically, bjwflate flattens the contents of the file when you do it that way - in other words, the manifest is no longer under meta-inf, and thus the jar is invalid.

Doing it Hsaka's way should maintain the folder structure, and it should end up being valid.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.111 seconds with 22 queries.