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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:35:35+00:00 2026-06-15T12:35:35+00:00

I am currently working on a Java library – that is, a bunch of

  • 0

I am currently working on a Java library – that is, a bunch of classes that are exclusively intended to be used in other projects. Naturally, it has no main() function.

Now, I want to test my progress. And by “test” I don’t mean some professional standardized system; I mean I have a very simple function that I want to run to gather information, which will be modified as the project becomes more complete.

I was hoping I could drop an executable class into the Test Packages folder, and just click Run. Unfortunately, NetBeans complains that there are no main classes found.

So, how do I test a library project, without adding an executable class to my distributable source?

  • 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-15T12:35:35+00:00Added an answer on June 15, 2026 at 12:35 pm

    You should absolutely look into unit testing frameworks, such as JUnit. IDEs typically have support for running tests easily, and it looks like Netbeans does too. (I don’t use Netbeans myself, but I’d have been shocked if it didn’t support JUnit.) It’s a lot simpler to do this than to have main methods everywhere. After all, a main method will only test one route through your code – with unit tests, you can have lots of tests, each testing one small piece of your code.

    Even if you don’t want to go into unit testing in a fully-fledged way (which I’d strongly urge you to, by the way), unit tests can be a very straightforward way of just running some code and experimenting with it. I sometimes use it when developing against a 3rd party library for the first time – leaving unit tests to show and document my understanding of the library’s behaviour. (Obviously the better the library and its documentation, the less need there is for this, but it’s still useful…)

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

Sidebar

Related Questions

The Java library that I'm currently working on can be configured with a .properties
I'm currently working on a java project that requires me to make a system
I'm currently working on a project that is building a java-based desktop application to
I'm currently working on Mangler's Android implementation. I have a java class that looks
I am currently working on a project that uses a Google Earth API library
I am working to create a Java based web app that also has ability
Currently, I am working on a web application that uses draw2d library to draw
I am currently working in java projects. And I am handling many projects at
I am currently re-reading Effective Java while working at a shop that makes heavy
I'm currently working with the jodatime Java library and running into issues when trying

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.