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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:51:56+00:00 2026-05-18T11:51:56+00:00

I have to code some classes that are accessed from a program. The problem

  • 0

I have to code some classes that are accessed from a program. The problem is, I don’t have the source of the program, I only have the API that I have to comply with.

Now, I have the compiled class files in a jar and I can execute the program with my code from the command line with “java -cp prog.jar pkg.mainClass args”, but I cannot select the main class in netbeans in order to be able to quickly test my code.

Does anyone know whether it is possible to specify a main class that’s inside a jar?

  • 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-18T11:51:56+00:00Added an answer on May 18, 2026 at 11:51 am

    From what I see, you’ve got a jar file with no source and classes inside make up an API. Nothing new.

    But I’m scratching my head when I read this part:

    “Now, I have the compiled class files in a jar and I can execute the program with my code from the command line with “java -cp prog.jar pkg.mainClass args”, but I cannot select the main class in netbeans in order to be able to quickly test my code.”

    From that paragraph, it seems that the main class is inside that jar file. Also, you want to be able to quickly test your code. Do you mean that you’re changing that source, even though you haven’t got it? Or do you want do debug it? Or unit test it? This part seems a bit unclear.

    Your situation seems pretty confusing, so I can’t suggest anything else than just to make a new main class in Netbeans, import everything from that jar file and just use it’s API.

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

Sidebar

Related Questions

Edit: original question below, but I revise it now that I have some code
I have some code where I am serializing one of my classes that contains
I have some code which collects points (consed integers) from a loop which looks
I have some code in a javascript file that needs to send queries back
I have some code that gives a user id to a utility that then
I have some code which I am making available via RMI. If my program
If I have some classes that implement the same interface, so they all contain
I have questions about inheriting(extending) methods from classes and hiding some classes and methods
I have some code that consists of a lot (several hundreds of LOC) of
I have a new error with the code below. Originally I had some classes

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.