Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: How to print out the currently used JAR file path to verify it is using right JAR? Date: Fri, 7 Oct 2011 08:47:31 -0700 (PDT) Organization: http://groups.google.com Lines: 22 Message-ID: <3339288.679.1318002451499.JavaMail.geo-discussion-forums@prmi2> References: <4d7daeb4-7da7-47c0-a4cf-d3c5d1be2ef0@gd10g2000vbb.googlegroups.com> <13afa738-1198-4569-84be-9fc6627c52d6@t16g2000yqm.googlegroups.com> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 216.239.45.130 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1318002881 9188 127.0.0.1 (7 Oct 2011 15:54:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 7 Oct 2011 15:54:41 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=216.239.45.130; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8631 markspace wrote: > www wrote: >> Just to add more details about my question: >> >> In my code, I am using class Abc, which is from 3rd party JAR >> file(MyJAR.jar). I hope to print out Abc's class path to see it is >> from a/b/MyJAR.old.jar or from c/d/MyJAR.new.jar >> >> I understand the correct way is to check the classpath > > Shouldn't you just be setting this from the command line or in the main > Jar file? I'm a little confused by your question. You should know the > class path before the program starts executing. > > Can you just search the existing class path for occurrences of this > class "Abc"? System.getProperty("java.class.path") -- Lew