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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
mcpunjabi
Posts: 9
Joined: Tue Apr 23, 2024 3:03 am
Contact:

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

Post by mcpunjabi »

Not adding Class-Path: . in manifest made me looking for error for an hour: no main manifest attribute, in accounting.jar

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.

mcpunjabi
Posts: 9
Joined: Tue Apr 23, 2024 3:03 am
Contact:

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

Post 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)

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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 1622 times

mcpunjabi
Posts: 9
Joined: Tue Apr 23, 2024 3:03 am
Contact:

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

Post by mcpunjabi »

yes probably i'll check it later

sorry for this short waste of your time

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 16 guests