Page 1 of 1

[HD Pg 22, Sec. 1.8.2 - packaging-classes-into-jar]

Posted: Wed Apr 24, 2024 4:34 am
by mcpunjabi
Not adding Class-Path: . in manifest made me looking for error for an hour: no main manifest attribute, in accounting.jar

Re: [HD Pg 22, Sec. 1.8.2 - packaging-classes-into-jar]

Posted: Wed Apr 24, 2024 7:12 am
by admin
There is no need to add Class-Path: . in manifest. You must be doing something different from the steps explained in the book. Which JDK are you using?

I tried the steps exactly as given in the book just now and it worked fine. No Class-Path: . in manifest.

Re: [HD Pg 22, Sec. 1.8.2 - packaging-classes-into-jar]

Posted: Wed Apr 24, 2024 8:25 am
by mcpunjabi
i followed book instructions

JDK version:
java version "11.0.16" 2022-07-19 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.16+11-LTS-199)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.16+11-LTS-199, mixed mode)

Re: [HD Pg 22, Sec. 1.8.2 - packaging-classes-into-jar]

Posted: Wed Apr 24, 2024 8:53 am
by admin
Something is messed up with your JDK installation.

See the attached screenshot. It shows the contents of the manifest as well as the output of java -version. You can see that there is no Class-Path in the manifest. It is not required and it shouldn't be there anyway.
test.png
test.png (18.21 KiB) Viewed 855 times

Re: [HD Pg 22, Sec. 1.8.2 - packaging-classes-into-jar]

Posted: Thu Apr 25, 2024 3:04 am
by mcpunjabi
yes probably i'll check it later

sorry for this short waste of your time