Article View: borland.public.jbuilder.java.language
Article #8040Re: Compiling and Accessing Packages?
From: hi
Date: Sun, 29 Apr 2001 12:39
Date: Sun, 29 Apr 2001 12:39
49 lines
2551 bytes
2551 bytes
Hi, Thanks for the response. This worked: D:\java\Chap5>java -classpath .;D:\java TestPackage If I didn't use the ".;", I got an error: D:\java\Chap5>java -classpath D:\java TestPackage Exception in thread "main" java.lang.NoClassDefFoundError: TestPackage "Joi Ellis [TeamB]" <joi@aravox.com> wrote in message news:3aeb86a7_1@dnews... > hi <noneofyourbusiness@none.com> wrote: > [snip] > > To compile the package, I used this command: > > D:\java\Animals\Dogs>javac -classpath D:\java TestDogs.java > > and all the .class files for Poodle.java, Spaniel.java, and TestDogs.java > > appeared in the folder D:\java\Animals\Dogs. Then I tried to access the > > package from TestPackage.java in the D:\java\Chap5 directory: > > D:\java\Chap5>javac -classpath .;D:\java\Animals\Dogs TestPackage.java > [snip] > > Then I tried this: > > D:\java\Chap5>javac -classpath .;D:\java TestPackage.java > > which seemed to compile because I got this: > > D:\java\Chap5> > > so, I entered: > > D:\java\Chap5>java TestPackage > > which gave me this output: > > ================ > > Exception in thread "main" java.lang.NoClassDefFoundError: > > Animals/Dogs/Spaniel > > at TestPackage.main(TestPackage.java:6) > > ======================================== > > The command you use to run the code should be nearly identical to what > you used to compile: > > java -classpath D:\java Animals.Dogs.TestPackage > > You don't need "." in your classpath at all. > -- > Joi Ellis (TeamB) > No direct email, please. > For best results, post on news server newsgroups.borland.com! > Newsgroup Info: http://www.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<3aec0bd5_1@dnews>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3aeb6dd9_1@dnews> <3aeb86a7_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,e13db2519d61bb0d X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-29 05:44:01 PST From: "hi" <noneofyourbusiness@none.com> Newsgroups: borland.public.jbuilder.java.language References: <3aeb6dd9_1@dnews> <3aeb86a7_1@dnews> Subject: Re: Compiling and Accessing Packages? Date: Sun, 29 Apr 2001 06:39:59 -0600 Lines: 51 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 208.187.59.176 Message-ID: <3aec0bd5_1@dnews> X-Trace: dnews 988548053 208.187.59.176 (29 Apr 2001 05:40:53 -0700) Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews