Classpath

Discussion in 'Java' started by freesoft_2000, Aug 26, 2005.

  1. 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
     
    freesoft_2000, Aug 26, 2005
    #1
    1. Advertising

  2. freesoft_2000

    Roedy Green Guest

    On Fri, 26 Aug 2005 17:18:43 -0400, "freesoft_2000"
    <> 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.
     
    Roedy Green, Aug 27, 2005
    #2
    1. Advertising

  3. freesoft_2000

    Roedy Green Guest

    On Fri, 26 Aug 2005 17:18:43 -0400, "freesoft_2000"
    <> 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.
     
    Roedy Green, Aug 27, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil Hanna
    Replies:
    0
    Views:
    1,311
    Phil Hanna
    Jul 1, 2003
  2. Flip
    Replies:
    3
    Views:
    7,279
    Tony Morris
    Feb 9, 2004
  3. Gabe
    Replies:
    3
    Views:
    1,078
  4. Replies:
    2
    Views:
    755
  5. Replies:
    2
    Views:
    1,111
    Mike Schilling
    Mar 2, 2008
Loading...

Share This Page