Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7068147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:17:19+00:00 2026-05-28T05:17:19+00:00

Imagine there is a jar (named lib.jar ) that contains a single class and

  • 0

Imagine there is a jar (named lib.jar) that contains a single class and manifest file.

The class is MyLibClass1. MyLibClass1 class contains single public static method execute().

The manifest file has a line “Class-Path:” that reference other jar files (jar1.jar and jar2.jar)

MANIFEST.MF is in the META-INF of the lib.jar and contains:

Class-Path: jar1.jar jar2.jar

These jars are used in some project MyProject and are located in libs directory of it.

The project has a main class Main with method main and has only 1 line:

MyLibClass1.execute();

The problem is that when I try to invoke Main class of MyProject, JVM says that it is not able to find the MyLibClass1 class that is in the lib.jar.

java -cp libs/*;bin Main

Any suggestions?

UPDATE:

java -version
java version “1.6.0_24”
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)

The libs folder contains lib.jar, jar1.jar and jar2.jar

There is a good comment about where is Main.class.
In fact the class in bin directory, so I have to change the java execution command.

java -cp libs/*;bin Main

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:17:20+00:00Added an answer on May 28, 2026 at 5:17 am

    I have solved the problem by removing manifest from lib.jar file.

    Therefore there is a bit confusing conclusion: “Class-Path:” of a jar hides the classes of a jar itself.

    Welcome to disprove this statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine a 5 MB jar file that contains many main classes, each of which
Imagine there is a Customer class with an instance Load() method. When the Load()
On C# 3.0 and .NET 3.5, imagine there's an interface: public interface INameable {
Is there any way to check if a particular plugin is available? Imagine that
There is one thing that I do not understand... Imagine you have a text
Good morning all. Is there any jsf control that escapes the html tags? Imagine
Imagine there is a file of size 5 MB. I open it in write
imagine there is an sql and in some part of that SP, there is
Imagine there are 5 sublinks (having class searchBySub ) and 5 corresponding buttons on
The steps are as simple as that so I imagine there's something else going

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.