Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a manifest file #27

Open
adelbs opened this issue Mar 29, 2019 · 14 comments
Open

Create a manifest file #27

adelbs opened this issue Mar 29, 2019 · 14 comments

Comments

@adelbs
Copy link
Owner

adelbs commented Mar 29, 2019

Hi.
I tried maven package and indeed it built a jar file to the target directory. But, however, when I issue java -jar Adelbs-ISO8583-1.1.1.jar it comes back with the message

c:\iso8583\ISO8583-master\target>java -jar Adelbs-ISO8583-1.1.1.jar
no main manifest attribute, in Adelbs-ISO8583-1.1.1.jar

Originally posted by @bastet77 in #26 (comment)

@adelbs
Copy link
Owner Author

adelbs commented Mar 29, 2019

To execute the jar file, run this command:

java -cp ./Adelbs-ISO8583-1.1.1.jar org.adelbs.iso8583.Main

I'll create the manifest as soon as possible.

@bastet77
Copy link

bastet77 commented Mar 29, 2019 via email

@adelbs
Copy link
Owner Author

adelbs commented Mar 29, 2019

Hi Ed!

What JDK version did you use to compile it?
What java -version are you using to run it?
What is your operating system?

This line refers to this code:

setIconImage(Toolkit.getDefaultToolkit().getImage(Main.class.getResource("/org/adelbs/iso8583/resource/package.png")));

So, check if inside the generated jar file there is this image: /org/adelbs/iso8583/resource/package.png

If not, there is something wrong with the build.

@bastet77
Copy link

bastet77 commented Mar 29, 2019 via email

@adelbs adelbs added this to Roadmap in Adelbs-ISO8583 v.0.1 Mar 30, 2019
@ab4cus
Copy link

ab4cus commented Mar 31, 2019

Hi Adelbs

I could already compile with the version of java 1.8 on my Mac osx 10.13.6

> Schmuckes-MacBook-Pro:target schmucke$ java -version
> java version "1.8.0_202"
> Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
> Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
> 

but I had the same error

> Schmuckes-MacBook-Pro:target schmucke$ java -cp ./Adelbs-ISO8583-1.1.1.jar org.adelbs.iso8583.Main
> Exception in thread "main" java.lang.NullPointerException
> 	at sun.awt.SunToolkit.imageCached(SunToolkit.java:899)
> 	at sun.lwawt.macosx.LWCToolkit.getImage(LWCToolkit.java:549)
> 	at org.adelbs.iso8583.Main.<init>(Main.java:50)
> 	at org.adelbs.iso8583.Main.main(Main.java:25)

@ab4cus
Copy link

ab4cus commented Mar 31, 2019

verifying and the jar is missing the entire resource folder, unload it, copy the folder and repackage it and it works, something must be missing in the maven

@bastet77
Copy link

Hi,
What commands did you use to unload and reload a jar file. I tried to add the file to the jar using zip but then when I executed the java command I got....

c:\ISO8583\ISO8583-master\target>java -cp ./Adelbs-ISO8583-1.1.1.jar org.adelbs.iso8583.Main
Error: Could not find or load main class org.adelbs.iso8583.Main

Clearly I have done something wrong.

@ab4cus
Copy link

ab4cus commented Apr 1, 2019

Hi,
use the jar tool to unpack and package, the zip compress and decompress it is not correct.

https://docs.oracle.com/javase/tutorial/deployment/jar/unpack.html

@bastet77
Copy link

bastet77 commented Apr 1, 2019 via email

@bastet77
Copy link

bastet77 commented Apr 1, 2019 via email

@tzifudzi
Copy link

tzifudzi commented Sep 5, 2019

Applied @ab4cus suggested fix and managed to succesfuly run the project.

@adelbs May I please take up this issue so I can provide a permanent fix? If so please assign the issue to me.

@ghost
Copy link

ghost commented Sep 17, 2019

@adelbs please accept the pull request, so the issue will be fixed, public still experiencing this issue

@TorgeirFladby
Copy link

Hi,

Given that no fix has yet been issued, would it be possible to get an explanation on:

  1. The path of the "resources" folder and the path to the destination folder where it should be copied
  2. Intructions on how to correctly repackage the updated repository.

Thank you in advance. :)

Br,

@tiagoms1
Copy link
Collaborator

tiagoms1 commented Sep 3, 2020

Are you guys still having the problem? From here what I did was to use the maven package on eclipse and also to have the JDK instead of the JRE. Please let us know here before we close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

6 participants