Code Comments
Programming Forum and web based access to our favorite programming groups.Hi all, I'm still a bit stuck with defining classpath for multiple-class applications. I'm trying to get an application with multiple classes to compile and run under Windows. (NT 4) I have the files (each containing 1 class of the same name as the file, i.e. DesimaaliAika.java contains the class DesimaaliAika and so on) DesimaaliAika.java, IkaRivi.java, MitsuRivi.java, YhdistelmaRivi.java and YhdistaRivit.java Where YhdistaRivit is the main class (dependent on IkaRivi, MitsuRivi and YhdistelmaRivi, which all depend on DesimaaliAika) in directory D:\Aki_java\yhdistarivitparam\ and the jdk in D:\Aki_java\jdk1.4\ However, (typed at the DOS prompt) "D:\Aki_java\jdk1.4\javac -classpath D:Aki_java\yhdistarivitparam D:\Aki_java\yhdistarivitparam\YhdistaRiv it.java" just results in the compiler giving "cannot resolve symbol" error msg for every reference to classes outside the main-class. (For example, " yhdistarivitparam\YhdistaRivit.java:62:cannot resolve symbol symbol: class IkaRivi location: class yhdistarivitparam.YhdistaRivit IkaRivi Ika = new IkaRivi(ikaPuskuri); ^ ^ ") What am I doing wrong here? -- -Aki "Sus" Laukkanen
Post Follow-up to this messageOn Wed, 22 Sep 2004 11:23:53 +0300, Aki "Sus" Laukkanen wrote: > What am I doing wrong here? I found your explanation a bit confusing (all those class names mean nothing to me, so they were all just swimming around in my head), but it occured to me that the package name was not referred to. Are these classes in a package? -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.lensescapes.com/ Images that escape the mundane
Post Follow-up to this messageAndrew Thompson wrote: > On Wed, 22 Sep 2004 11:23:53 +0300, Aki "Sus" Laukkanen wrote: > > > > > I found your explanation a bit confusing (all those > class names mean nothing to me, so they were all just > swimming around in my head), but it occured to me that > the package name was not referred to. Sorry about those confusing names... They're in Finnish ;) > Are these classes in a package? Yes, they all belong to package yhdistarivitparam. So how do I refer to the package? -- -Aki "Sus" Laukkanen
Post Follow-up to this messageOn Wed, 22 Sep 2004 11:51:29 +0300, Aki "Sus" Laukkanen <aki.laukkanenREMOVETHIS@helsinki.fi> wrote: > Andrew Thompson wrote: > > > Sorry about those confusing names... They're in Finnish ;) > > > Yes, they all belong to package yhdistarivitparam. > > So how do I refer to the package? You should set you Classpath to the _root_ of your package tree. That means, the directory that contains the first package. In your case that would be D:\Aki_java. See you Stefan -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Post Follow-up to this messageStefan Schulz wrote: > You should set you Classpath to the _root_ of your package tree. That > means, the directory that contains > the first package. In your case that would be D:\Aki_java. Ah. *slaps forehead* So _that_'s what I was doing wrong, setting the classpath inside the package directory instead of the dir. _containing_ the package dir. Thanks a lot for clearing that out. _Now_ I've finally understood how to compile from command line instead of using JBuilder's compile features... Which is a bit slower and, well, incompetent. :o) -- -Aki "Sus" Laukkanen
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.