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 8802175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:01:28+00:00 2026-06-14T01:01:28+00:00

I have recently developed some java applications that i want others to run on

  • 0

I have recently developed some java applications that i want others to run on their machines.
I did some research and now know that to distribute java code you need to create .jar file.
Well i did that, but when I am distributed those file it runs on some computers but on others it return an error saying: “Main class could not found”.

  1. Is there any problem with JRE version.
  2. How would a user know that on which version he/she should run the application.
  3. can i package the correct jre version with my app/jar file. how??
  4. Are jar files not compatible with other version of jre except in which they are compiled.
  • 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-06-14T01:01:29+00:00Added an answer on June 14, 2026 at 1:01 am

    Option1: Create a manifest file with entry as below and include in the jar:

         Main-Class: MainProgram
    

    Option2: Just mention your Main class name while running the program e.g. if you jar name is myprogram.jar and main class is MainProgram then run the program as below:

            java -cp myprogram.jar MainProgram
    

    If your MainProgram takes some arguments, them pass them as well in the command line e.g.

           java -cp myprogram.jar MainProgram argument1 argument2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I have a Java application that many programming clients interface with. Recently, a
I have a system that we have recently developed - a web application over
Recently I had to develop several web applications. I did extensive research regarding JavaScript
I have a simple Web App developed using Spring and recently I'm having some
I have recently running into some issues with the Provisioning Profile. Now I understand
In our application we are caching some frequently used data. Recently we have developed
I have developed a site that allows the users to embed widgets into their
i have recently developed a list program in android in which there is an
I have recently began using C# to invoke powershell scripts, with some success :)
I've been doing quite large application recently with Java - Swing. Now I'd like

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.