You are absolutely right.  Another way to say that is to say that
  • The "directory structure" of the "package hierarchy" structure must reflect the package statement in the source.
  • The CLASSPATH entry must be the "root directory" of the "package hierarchy".
This is always true except when no hierarchical file system is used, as in Visual Age for Java which stores all source in an internal database and uses source analysis to resolve package distinctions.
 
However, this is not apropos to the problem at hand.  If his java source were in the wrong directory or if the CLASSPATH entry did not connect to the package hierarchy,  then his code simply would not compile at all.
 
-- Roger Glover
-----Original Message-----
From: Kola Oyedeji [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 03, 2003 3:24 AM
To: JDJList
Subject: [jdjlist] Re: package and CLASSPATH

Being a bit of a newbie  I may be wrong but I think your directory structure must match the package name:

So the directory structure would be something like:

 

C:\x\com\multigarmenjaya\coba;

 

And the class path:

 

C:\x

 

 

Can anyone confirm this?

 

 

Kola

 

-----Original Message-----
From: Paul Franz [mailto:[EMAIL PROTECTED]]
Sent
:
01 February 2003 16:08
To: JDJList
Subject: [jdjlist] Re: package and CLASSPATH

 

You need to specify the -d parameter on the javac command line.

For example, javac -d c:\x\classes c:\x\*.java

Paul Franz

----- Original Message -----
From: "Lambok Sianturi"
<[EMAIL PROTECTED]>Date: Fri, 31 Jan 2003 09:40:15 +0700
To: "JDJList"
<[EMAIL PROTECTED]>Subject: [jdjlist] package and CLASSPATH

Hallo again,

I'm so thankful have find this mail list. :)

 

I'm now have another problem and question.

I have write a .java class, and I want to put the .class file in a package. So I add a package statement like this:

 

package com.multigarmenjaya.coba;

 

and the CLASSPATH = C:\x\classes;C:\x

 

in which C:\x is my working folder and C:\x\classes is an empty foder.

 

I try to compile the source but the package folder doesn't created. Instead the .class file exist in the working folder. Would someone please tell me where I'm going wrong ? Another question, if a CLASSPATH variable contains more than one folders and we compile a java source wich contains package statament, in which folder the package will be located ?

 

Thanks in advance.

 

::Lambok Sianturi::
==(OFFICE BOY)==
PT. Multi Garmenjaya
Jl. Krawang No. 1
Bandung - Jawa Barat
Phone : 62 22 7272222

____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________ --

_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com

Meet Singles

____________________________________________________ To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm Be respectful! Clean up your posts before replying ____________________________________________________

____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________
____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to