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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:40:24+00:00 2026-05-12T11:40:24+00:00

I have a NetBeans project set up with a bunch of source classes and

  • 0

I have a NetBeans project set up with a bunch of source classes and about 10 jUnit test classes in a separate Test folder.

From within the Test files I can import any other test file or source class. However, from within the normal source files, NetBeans acts as if the Test classes don’t exist. Autocomplete on them won’t work, and if I attempt to use them I get a compile error.

I understand that normally it wouldn’t make sense to use a Test class from the regular source, but I have a good reason in this case. Part of my program accepts a class name as a string and creates and instance of it with reflection. One of my jUnit tests calls this method to test it, and passes it the name of a Test class. This always fails because the normal program code can’t find any of the classes from the Test folder.

  • 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-12T11:40:24+00:00Added an answer on May 12, 2026 at 11:40 am

    While running a test the classpath will include the source and test classes. They must, and I don’t think it would really be possible to prevent one from accessing the other at runtime, even with class loaders. I certainly highly doubt that Netbeans is doing it, even if it is theoretically possible.

    There are two possibilities that I could guess at. One is that the error is not what you think it is. If you post a stack trace, we could help you with that.

    The other is that you are using the wrong class loader to load the class (i.e. not just using Class.forName()). Can you post the code snippit doing the class loading?

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

Sidebar

Related Questions

We have a netbeans project that has an xsd that we use to create
Java Newbie here. I have a JFrame that I added to my netbeans project,
In Netbeans (I have the 6.5 version), in the project properties under Application> Webstart
I have a project that I am building with Netbeans 6.1 and I am
I have been using Netbeans 6.5 recently - it complains (on startup, and if
I have established a link using Netbeans and Paradox driver and can query the
I have a simple application using netbeans for developing and maven for building et
I use Netbeans IDE (6.5) and I have a SQLite 2.x database. I installed
I learned today that NetBeans 6.5 should have an on-the-fly compilation of (single) Java
Do you have any tips for effective profiling using Netbeans? The profiler is quite

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.