Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

NetBeans & Classpath issue

Posted on 2004-10-20
11
Medium Priority
?
599 Views
Last Modified: 2013-11-23
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
0
Comment
Question by:lomidien
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 1000 total points
ID: 12358947
>> if I import from a library, it will sometimes show that it does not exist
In netBeans the corresponding jar must be mounted
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12358953
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
 
LVL 37

Expert Comment

by:zzynx
ID: 12358961
>> ...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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 37

Expert Comment

by:zzynx
ID: 12359002
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
 
LVL 37

Expert Comment

by:zzynx
ID: 12359021
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12359036
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 12359042
>>Sometimes is

=
Sometimes if
0
 

Author Comment

by:lomidien
ID: 12359199
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 12359251
They don't probably don't *have* to be mounted if you follow what i said earlier
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12359252
Thanks for accepting.
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12359281
> 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

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question