Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Classpath

Reply
Thread Tools

Classpath

 
 
freesoft_2000
Guest
Posts: n/a
 
      08-26-2005
Hi everyone,

I need to ask a very generalised question about
classpath.

Now i have a java class file named JTim.class

Now on the command line i run JTim like that

C:\j2sdk1.4.2\bin\java -cp .;C:\WINDOWS\Desktop\JProc\ JTim

Now do you guys see the folder in which JTim is in which is called
JProc. You see in JProc there is another folder called JProcTim

Now in the folder called JProcTim is a java class file also named
JTim.class

Now my question taking into account that to run the class JTim in the
JProc i did this

C:\j2sdk1.4\bin\java -cp .;C:\WINDOWS\Desktop\JProc\ JTim

is why does the intrepreter run the JTim class in the JProcTim folder and
not the one i specified which is the JTim class in the JProc folder?

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      08-26-2005
On Fri, 26 Aug 2005 17:18:43 -0400, "freesoft_2000"
<(E-Mail Removed)> wrote or quoted :

>C:\j2sdk1.4.2\bin\java -cp .;C:\WINDOWS\Desktop\JProc\ JTim


What this says is:

use the jdk 1.4 debug version of the java run time.
The classes are either in the current directory or
C:\WINDOWS\Desktop\JProc\
The name of the class file is JTim.class
It has the default (no) package.

Inside the JTim.java file you should see public class JTim with a
public static void main method. It should have no package statement.

For further hints, see http://mindprod.com/jgloss/classpath.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      08-26-2005
On Fri, 26 Aug 2005 17:18:43 -0400, "freesoft_2000"
<(E-Mail Removed)> wrote or quoted :

>is why does the intrepreter run the JTim class in the JProcTim folder and
>not the one i specified which is the JTim class in the JProc folder?


Chances are it is because you have a package statement which changes
everything.

See http://mindprod.com/jgloss/package.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.classpath file instead of the CLASSPATH Environment variable. dontspammenow@yahoo.com Java 2 03-02-2008 08:19 AM
problem compiling project, classpath in xml ".classpath" "<classpathentry...>" jameshanley39@yahoo.co.uk Java 2 03-02-2007 12:37 PM
while using javac -classpath some.jar some.java (Where does classpath get stored?) Gabe Java 3 08-27-2004 07:02 PM
CLASSPATH, -cp and -classpath misunderstanding? Flip Java 3 02-09-2004 10:09 PM
Re: Classpath when running with the -jar option? Phil Hanna Java 0 06-30-2003 11:30 PM



Advertisments