Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Classpath definition (Oh, bother...)
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


Report this thread to moderator Post Follow-up to this message
Old Post
Aki \Sus\ Laukkanen
09-22-04 02:10 PM


Re: Classpath definition (Oh, bother...)
On 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

Report this thread to moderator Post Follow-up to this message
Old Post
Andrew Thompson
09-22-04 02:10 PM


Re: Classpath definition (Oh, bother...)
Andrew 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


Report this thread to moderator Post Follow-up to this message
Old Post
Aki \Sus\ Laukkanen
09-22-04 02:10 PM


Re: Classpath definition (Oh, bother...)
On 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/

Report this thread to moderator Post Follow-up to this message
Old Post
Stefan Schulz
09-22-04 02:10 PM


Re: Classpath definition (Oh, bother...)
Stefan 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


Report this thread to moderator Post Follow-up to this message
Old Post
Aki \Sus\ Laukkanen
09-22-04 02:10 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:17 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.