Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2004

Tip: Looking for answers? Try searching our database.

classpath compilation problems

Thread view: 
VI - 20 Apr 2004 15:32 GMT
Hi

I'm trying to compile all my java files without the need to compile
separately.

I have basically only two directories to worry about:

o the working directory from where I will run the application
o another directory within it which has some files

Both directories have classes which refer to classes in the other.

Unfortunately, I am getting a problem on different systems:

java.lang.NoClassDefFoundError: theSoCalledNonExistentClass

I am using the following compile statement which is run from the working
directory (.):

% javac -classpath .;TheOtherDirectory MainClass.java (or *.java)

What is wrong with this?

Many thanks

VI
Martin Winkelbauer - 21 Apr 2004 08:43 GMT
> Hi
>
[quoted text clipped - 22 lines]
>
> VI

If a package statement is in the .java files then the classpath must refer
the root of that not the directory the .java is in.

hth
Martin
Roedy Green - 22 Apr 2004 05:48 GMT
>javac -classpath .;TheOtherDirectory MainClass.java (or *.java)
>
>What is wrong with this?

see http://mindprod.com/jgloss/classpath.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.