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

  • Home
  • SEARCH
  • 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 3455810
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:39:35+00:00 2026-05-18T09:39:35+00:00

I have a project where in one package I have made Server and in

  • 0

I have a project where in one package I have made Server and in Second Package I made Client. It is working fine. I want to create a Jar file. Is it possible to run Client and Server Separately from same jar file?

I have used jar file where there is only one main and when I run jar file, it automatically runs that class. Now here I will be having 2 executable classes. I want to pack them in only one jar and then want to run both from that same jar file. Is it possible? Any Suggestions, links will be of great help.

  • 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-18T09:39:35+00:00Added an answer on May 18, 2026 at 9:39 am

    The short answer is, YES!

    The longer answer is that you can specify the class in your command line as well as putting the .jar in the classpath.

    Assume two classes

    A.class 
    B.class
    

    jar them into a .jar file

    jar cvf AB.jar A.class B.class
    

    run either of them

    java -classpath AB.jar A
    java -classpath AB.jar B
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need to have one project on asp.net mvc 1 but i want to
Let's say I have one project with the following POM: <groupId>com.mine</groupId> <artifactId>coreJar</artifactId> <packaging>jar</packaging> <version>0.0.1-SNAPSHOT</version>
I have migrated Project server from one server to another. I am able to
I have developed one project(java), In that i have copied few jar files and
Here I create one project that will track our current location. But I have
I have one project with is developed in Php and javascript. How to open
I have an SSIS project where one of the steps involves populating a SQL
I have several projects open in an Eclipse workspace. Like so: com.harbl.project.one com.harbl.project.two com.harbl.project.three
Underneath one Project in TFS we have multiple products. This is because for us,
in my project i have one registration form which is developed in C#.net.to this

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.