NetBeans & Classpath issue

Hello everyone, quick question concerning NetBeans and my classpath settings.

For my development machine, I have the following setup:  

Classpath = D:\classpath
JAVA_HOME = c:\j2skd1.4.2_05\bin

Now, I archive all java jars into a seperate folder just for archival purposes and I keep only those jars which I'm either currently using or use frequently in my classpath.  In NetBeans, if I import from a library, it will sometimes show that it does not exist...although the proper jar file is in the classpath. I have even gone as far as unzipping the jar file and then building the directory structure itself within the classpath just to ensure that it is there.  Now, if I mount the jarfile within NetBeans, then the code will compile as NetBeans is able to find the proper import files.

I'm really at a loss as why this is....I'm sure it must be a stupid mistake on my part.

Thanks,
David
lomidienAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
zzynxConnect With a Mentor Software engineerCommented:
>> if I import from a library, it will sometimes show that it does not exist
In netBeans the corresponding jar must be mounted
0
 
CEHJCommented:
There's a contradiction here - you talk about jars, yet there are none in your classpath. A classpath involving jars must put the full path to the jar file
0
 
zzynxSoftware engineerCommented:
>> ...although the proper jar file is in the classpath.
netBeans doesn't use that one, only the mounted jar's
(That's my experience)
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
zzynxSoftware engineerCommented:
I quote:

Mounting filesystems not only defines the contents of a project, it also defines the Java classpath for the project. Unlike in command-line development, the IDE ignores the CLASSPATH variable on your system and builds a unique internal classpath for each of your projects. This classpath is made up of all the mounted filesystems, including hidden filesystems and filesystems that are mounted by default by the IDE.
0
 
zzynxSoftware engineerCommented:
0
 
CEHJCommented:
There are two parts to this:

1. Java won't use jars in the classpath unless the full path is used
2. No IDE that i know of will use a jar unless it's explictly added via the GUI. Sometimes is you put it in the ext directory it will pick it up anyway
0
 
CEHJCommented:
>>Sometimes is

=
Sometimes if
0
 
lomidienAuthor Commented:
Thanks all.  Yeah, it has been my experience that they must be mounted....I just didn't think that it was necessarily so.  I thought perhaps I had a setting wrong or something else, but if they must be mounted, they must be mounted.

Thanks,
David
0
 
CEHJCommented:
They don't probably don't *have* to be mounted if you follow what i said earlier
0
 
zzynxSoftware engineerCommented:
Thanks for accepting.
0
 
Giant2Commented:
> I archive all java jars into a seperate folder just for archival purposes and I keep only those jars which I'm either currently using or use frequently in my classpath.  In NetBeans, if I import from a library...

If you want to use jar you must mount this external jar.
Are you sure the jar is accessible from NetBeans (not exist some constraint, permission,etc. on te filesystem)?
If you declare the classpath out of the IDE, normally it's ignored.
If you have even now the problem, see the project properties. Maybe you have specified something in the classpath prop.

Bye, Giant.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.