aspose file tools*
The moose likes Beginning Java and the fly likes Classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Classpath" Watch "Classpath" New topic
Author

Classpath

Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
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



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



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
Andrew Morris
Greenhorn

Joined: Aug 27, 2005
Posts: 8
What is the current directory when you execute the java command

-----------------
Andrew Morris
www.devsquare.com
DevSquare - Online Application Development
Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
Hi everyone,

Originally posted by Andrew Morris:
What is the current directory when you execute the java command


The current dirctory is JProc

Richard West
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
How do you know that the class in JProcTim is being run? Also, have you declared JTim to be included in a specific packagea? If so, what package is JTim in?

Layne


Java API Documentation
The Java Tutorial
Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
Hi everyone,

Originally posted by Layne Lund:
How do you know that the class in JProcTim is being run?


Because the program runs and the JFrame shows up. The .class files may have the same names but they are actually different programs


Originally posted by Layne Lund:
Also, have you declared JTim to be included in a specific packagea? If so, what package is JTim in?


No JTim is not in any package at all

Richard West
Naveen Vooka
Greenhorn

Joined: Aug 23, 2005
Posts: 5
1) What happens if you remove the JTim inside the JProcTim and then run
the command?
2) Try to print the classpath from inside the program. I think you can
retrieve it from system properties by System.getProperty("java.class.path").


Naveen Vooka<br /><a href="http://www.devsquare.com" target="_blank" rel="nofollow">www.devsquare.com</a><br />DevSquare - Online Application Development
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classpath