ISO8583 icon indicating copy to clipboard operation
ISO8583 copied to clipboard

Create a manifest file

Open adelbs opened this issue 6 years ago • 14 comments

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 https://github.com/adelbs/ISO8583/issues/26#issuecomment-477803725

adelbs avatar Mar 29 '19 03:03 adelbs

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.

adelbs avatar Mar 29 '19 03:03 adelbs

Hi,

I tried that and got:-

c:\ISO8583\ISO8583-master\target>java -cp ./Adelbs-ISO8583-1.1.1.jar org.adelbs.iso8583.Main

Exception in thread "main" java.lang.NullPointerException

    at sun.awt.SunToolkit.getImageFromHash(Unknown Source)

    at sun.awt.SunToolkit.getImage(Unknown Source)

    at org.adelbs.iso8583.Main.<init>(Main.java:50)

    at org.adelbs.iso8583.Main.main(Main.java:25)

Regards,

Ed Holt

From: Felipe Jacob [email protected] Sent: 29 March 2019 03:46 To: adelbs/ISO8583 [email protected] Cc: bastet77 [email protected]; Mention [email protected] Subject: Re: [adelbs/ISO8583] Create a manifest file (#27)

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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adelbs/ISO8583/issues/27#issuecomment-477856074 , or mute the thread https://github.com/notifications/unsubscribe-auth/ADN0TBA7a4aXmuf3GTSfuScmJ6LAar8vks5vbYxggaJpZM4cRkSC . https://github.com/notifications/beacon/ADN0TKiFQyhFqbo9Z-wiw-JqHMS6HMS0ks5vbYxggaJpZM4cRkSC.gif

bastet77 avatar Mar 29 '19 12:03 bastet77

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.

adelbs avatar Mar 29 '19 17:03 adelbs

Hi

[INFO]

[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ Adelbs-ISO8583 ---

[INFO] Building jar: c:\ISO8583\ISO8583-master\target\Adelbs-ISO8583-1.1.1.jar

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 10.165 s

[INFO] Finished at: 2019-03-29T21:52:34Z

[INFO] ------------------------------------------------------------------------

c:\ISO8583\ISO8583-master>mvn -version

Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T19:41:47+01:00)

Maven home: c:\maven\bin..

Java version: 1.8.0_112, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_112\jre

Default locale: en_GB, platform encoding: Cp1252

OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

c:\ISO8583\ISO8583-master>cd target

c:\ISO8583\ISO8583-master\target>

c:\ISO8583\ISO8583-master\target>echo %java_home%

C:\Program Files\Java\jdk1.8.0_112

c:\ISO8583\ISO8583-master\target>

Hi did a search for png in the jar file and didn’t find anything. All the pngs are in the resource file.

Hope this helps,

Regards

Ed Holt

From: Felipe Jacob [email protected] Sent: 29 March 2019 17:49 To: adelbs/ISO8583 [email protected] Cc: bastet77 [email protected]; Mention [email protected] Subject: Re: [adelbs/ISO8583] Create a manifest file (#27)

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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adelbs/ISO8583/issues/27#issuecomment-478090273 , or mute the thread https://github.com/notifications/unsubscribe-auth/ADN0TO4zioiUS_YaLUec4rgEBKtbYGBuks5vblILgaJpZM4cRkSC . https://github.com/notifications/beacon/ADN0TD9i5VuoEXUX8IdnFeGoxwfRRKtgks5vblILgaJpZM4cRkSC.gif

bastet77 avatar Mar 29 '19 22:03 bastet77

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 avatar Mar 31 '19 01:03 ab4cus

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

ab4cus avatar Mar 31 '19 01:03 ab4cus

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.

bastet77 avatar Mar 31 '19 09:03 bastet77

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

ab4cus avatar Apr 01 '19 12:04 ab4cus

Hi,

Thanks for that. Worked a treat.

Regards,

Ed Holt

On Mon, 1/4/19, Ab4cus [email protected] wrote:

Subject: Re: [adelbs/ISO8583] Create a manifest file (#27) To: "adelbs/ISO8583" [email protected] Cc: "bastet77" [email protected], "Mention" [email protected] Date: Monday, 1 April, 2019, 14:57

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

bastet77 avatar Apr 01 '19 15:04 bastet77

Hi,

OK got past the missing resources but now when I press any thing on the panel I get other exception errors;-

c:\temp>java -cp ./Adelbs-ISO8583-1.1.1.jar org.adelbs.iso8583.Main Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For inpu t string: "" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at org.adelbs.iso8583.gui.PnlISOProperties.save(PnlISOProperties.java:97 ) at org.adelbs.iso8583.gui.PnlISOProperties$1.actionPerformed(PnlISOPrope rties.java:52) at javax.swing.JComboBox.fireActionEvent(Unknown Source) at javax.swing.JComboBox.setSelectedItem(Unknown Source)

Regards,

Ed Holt


On Mon, 1/4/19, Ab4cus [email protected] wrote:

Subject: Re: [adelbs/ISO8583] Create a manifest file (#27) To: "adelbs/ISO8583" [email protected] Cc: "bastet77" [email protected], "Mention" [email protected] Date: Monday, 1 April, 2019, 13:57

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

bastet77 avatar Apr 01 '19 17:04 bastet77

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.

tzifudzi avatar Sep 05 '19 14:09 tzifudzi

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

ghost avatar Sep 17 '19 08:09 ghost

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,

TorgeirFladby avatar Jan 29 '20 12:01 TorgeirFladby

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.

tiagoms1 avatar Sep 03 '20 21:09 tiagoms1