• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classpath

 
Richard West
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the current directory when you execute the java command

-----------------
Andrew Morris
www.devsquare.com
DevSquare - Online Application Development
 
Richard West
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Richard West
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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").
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic