Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Posts
    27

    Unanswered: is it possible to show where the location of the class file in runtime?

    is it possible to show where the location of the class file in runtime?

    eg.
    If I have two copies of the same class within the CLASSPATH? is there any method that I can call to show which copy of that class is running?

    export CLASSPATH=/dir1:/dir2:.
    ---------------------------------------------------

    File Location:
    /dir1/myfile.class <-- may be deleted sometimes....
    /dir2/myfile.class

    ---------------------------------------------------

    when run the myfile class, can I display if I am using the copy in /dir1 or /dir2?

  2. #2
    Join Date
    Nov 2003
    Location
    Pune, India
    Posts
    22
    Hi use the following-

    System.out.println( <Class-name>.class.getResource(""));
    Regards,
    Amit.K.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •