simple classpath question`

C

cppaddict

I thought I understood classpaths, but I encountered an error I could
not explain.

I have my classpath set to:

C:\Project1;C:\Project2

Note that these folders are not packages themselves, but are the root
folders containing all the package folders and class files.

One class contained inside of a package in Project2 imports and uses a
class contained inside of package in Project1. I am getting a
NoClassDef found error. I could have sworn that this has worked
before.

Can someone set me straight on how I need to set this up?

Thanks in advance,
cpp
 
C

Chris Smith

cppaddict said:
I have my classpath set to:

C:\Project1;C:\Project2

Note that these folders are not packages themselves, but are the root
folders containing all the package folders and class files.

One class contained inside of a package in Project2 imports and uses a
class contained inside of package in Project1. I am getting a
NoClassDef found error. I could have sworn that this has worked
before.

Can someone set me straight on how I need to set this up?

There's nothing wrong with anything that you posted. Is there any
additional information in the NoClassDefFoundError? For example, if it
includes the words "wrong name", then that'll be a clue that helps a
lot.

As a sort of long shot, are you running application with java -jar? Or
with the -classpath option to the JVM? Either of those will prevent the
JVM from checking your classpath environment variable.

Failing any of that, it's probably best for you to poke around and look
for any additional information you can provide on the problem; enough
for someone to try to reproduce it (I don't get an error with the setup
you describe above).
 
C

cppaddict

There's nothing wrong with anything that you posted.

Thanks Chris. I just wanted to make sure my understanding wasn't
flawed. Probably something simple then. I'll take another look.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top