How to know which class is being loaded from which jar file & path location

Hi,
I have some Java code using several jar files.
I want to remove those jar files which are not being used by the code.
So , I want the JVM to output which class is being loaded from which jar .
Using "java -verbose" option doesnt solve the problem because the required info is printed only for the classes/jars native to the J2SE package .
Can anyone provide a solution which does not require me to modify the code?
Thanks,
Danish

Classpath Helper

Similar Messages

  • How do I remove certain data being imported from a php file

    I have data being loaded from a php into an xml class.
    My host (which is free for testing purposes) keeps adding data to the php file which causes errors.  I need to know how I can delete this extra text before I put the data into an XML class so I do not get the error.  I did a trace of the data and this is what comes up below.  I need everything below the </data> tag to be removed but do not know how to do this.  Can someone please help me.
    <?xml version='1.0' encoding='UTF-8'?><data>
        <google rate='21' />
        <yahoo rate='3' />
        <msn rate='2' />
        <tv rate='10' />
        <diger rate='4' />
    </data>
    <!-- www.000webhost.com Analytics Code -->
    <script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
    <noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
    <!-- End Of Analytics Code -->
    Thanks,
    Jason

    in your load complete function:
    var s:String=e.target.data;
    var xml:XML=XML(s.split("<!-- www.000")[0]));

  • How to add multiple images to a JLabel from the jar file

    I want to add multiple images in a JLabel but the icon property only allows me to add one. I thought I could use html rendering to add the images I need by using the <img> tab, but I need to use a URL that points to the image.
    How do I point to an image inside the jar file? If I can't, is there another way to show multiple images in a JLabel from the jar file?

    Thanks, it works perfectly. It's a really smart way of fixing the problem too :)
    I also found your toggle button icon classes which is something I've also had a problem with.
    Thanks.

  • Problem in resource loading from a JAR file

    My application requires to read a data file using single read operation. The size of the file is 42K. The datafile is packaged inside the jar file with the class files. The piece of code I used is as follows:
    InputStream in = Mainclass.class.getResourceAsStream("filename");
    DataInputStream din = new DataInputStream(in);
    int i = in.available();
    System.out.println(i);
    byte data[] = new byte[in.available()];
    din.readFully(data);
    din.close();
    But my program reads only one byte not the total file content. I traced and saw that
    available() methods retirns 1 instead of 42000.
    Can anybody tell me how can I do that?
    thanks,
    Fazilatur Rahman

    Hi,
    do the following
    InputStream in = Mainclass.class.getResourceAsStream("filename");
    DataInputStream din = new DataInputStream(in);
    int i = -1;
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    byte data[] = new byte[1024];
    while((i = din.read(data)) != -1)
       bos.write(data, 0, i);
    bos.flush();
    din.close();
    data = bos.toByteArray();

  • How to know which port is being used by which process

    Hi,
    Could you please tell me how to know which port is being used by which process.as iam getting ports are already in use.
    Thank you,
    Sravan
    Message was edited by:
    sravan123

    Your OS might provide a command to support this question like '"netstat".
    Besides, on Unix the pseudo-file system /proc is also useful.

  • How can I determine what LLB a VI is being loaded from?

    I've been frustrated switching between versions when an application opens and suddenly can not find a VI which is being loaded from a LLB.  How can I determine what LLB (or other type of library) a VI is being loaded from ? 
    Is there a list of all libraries along with what VIs are included in them somewhere?
    Thanks, 
    Dave 

    In the context help, enable "Show Optional Terminals and Full Path ", then just hover over your VI, either on the diagram on in the hierarchy view.
    LabVIEW Champion . Do more with less code and in less time .

  • How to load an applet jar file?

    Hello everyone,
    I have an applet that uses my own jar file and approximately 6 third party jar files. I set up jar indexing (jar -i) which will download the jar files when they are needed. All seems to work well, but now I want to manually load the jar files which I cannot get working.
    When the applet starts, about 1/2 of the jar files are downloaded (because they are needed at startup). I then want to load the additional jar files in the background, after the gui is initialized. I have tried this using the below thread which is executed from within the applet's start method:
    // Try to load additional jar files in background by loading a class from each jar file.
    Thread loadClass = new Thread() {
      public void run() {
        System.out.println("Loading classes...");
        try {
          // Tried loading classes this way, doesn't work.
          getClass().getClassLoader().loadClass("pkg1.Class1");
          getClass().getClassLoader().loadClass("pkg2.Class2");
          getClass().getClassLoader().loadClass("pkg3.Class4");
          getClass().getClassLoader().loadClass("pkg4.Class4");
          /* Loading classes this way doesn't work either.
          Class.forName("pkg1.Class1");
          Class.forName("pkg2.Class2");
          Class.forName("pkg3.Class3");
          Class.forName("pkg4.Class4");
        catch(ClassNotFoundException e) {
          // First attempt to load a class (pkg1.Class1) throws exception.
          System.out.println("Can't find class: " + e.getMessage());
    loadClass.start();As you can see from above I am trying to load a class from each of the jar files so that the jar files would load into memory/cache. Unfortunately, it cannot find the classes. These are the errors from the java console:
    Loading classes...
    Loading: pkg1.Class1
    Connecting http://my.server.com/my_dir/pkg1/Class1.class with no proxy
    Connecting http://my.server.com/my_dir/pkg1/Class1.class with cookie "JSESSIONID=some_big_long_char_list"
    Can't find class: pkg1.Class1
    So it appears the jar file is not being downloaded. When I take away the dynamic jar loading (removing the "jar -i" & adding them all to the applet archive list) the thread executes correctly. So I know the class names, etc, are correct. How does one load an applet jar file?
    Any help/suggestions are appreciated.

    The above error I posted was because I forgot to index the jar files. That is why it couldn't find the jar file. I thought I was getting farther along with my problem, but I apparently just forgot to index the jars. I am now getting the problem that I got yesterday...
    The applet freezes/hangs when it hits the thread. The GUI never opens (even though I'm running this thread right after the gui shows). The java console quits responding and the applet just stays the grey screen. I also tried the invoke later that you suggested.
    public void start() {
      // ...initialize gui...
      // Applet freezes and remains grey, also the java console freezes.
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          System.out.println("Loading classes...");
          try {
            // When I comment out the below forName calls, the thread will still run evidenced through the done print statement.
            Class.forName("pkg1.Class1");
         Class.forName("pkg2.Class2");
         Class.forName("pkg3.Class3");
         Class.forName("pkg4.Class4");
            System.out.println("...Done loading classes");
          catch(Exception e)     {
            System.out.println("Can't find class: " + e.getMessage());
    }

  • "JAXB 2.0 API is being loaded from the bootstrap ..." error in 1.6.0_07

    OK, I'm about tearing my hair out in clumps now!
    I get the above error when trying to compile a simple SOAP web service onto Tomcat 6.0.16.
    I've trawled the forums and Google and have tried the following: -
    1. I've re-installed the SDK and RE at rc 1.6.0_07 in case I missed the bug update on 18th July.
    2. Even though I shouldn't have to do this in 1.6.0_07 I've also tried: -
    a. Making an endorsed directory under TOMCAT_HOME and copying the JAX-WS 2.1 jar files in from NETBEANS\java2\modules\ext\jaxws21\api.
    b. Making an endorsed directory under JAVA_HOME\lib and copying the JAX-WS 2.1 jar files in from NETBEANS\java2\modules\ext\jaxws21\api.
    However, every time I stop Tomcat and do an undeploy/redeply on the web service I still get the "JAXB 2.0 API is being loaded from the bootstrap ..." error.
    What am I missing / doing wrong?
    Setup: -
    Win XP SP2
    Netbeans 6.5 Beta
    Java version 1.6.0_07rc

    Dear Juraj
    When a finally find what I have been searching occured a mistake in a program and the program had to be cancelled. It happened when we expected it the least. I do not know why have you getting angry. I did not tak� your calculator. Even touched it. No metter how big pitfalls are we have to do our our best to succeed.
    Best wishes
    Chose Carreras

  • Mail -- How can I change the default email account from which my messages go, without having to change it each time I draft a message?  It currently assumes an email account that I rarely use. Thanks.

    How can I change the default email account from which my messages go, without having to change it each time I draft a message?  It currently assumes an email account that I rarely use. Thanks.

    sorry, but I can't find the mail preference in the latest Yosemite OS. Do you know where I can find it?
    Thank you
    Don

  • Loading classes from another jar file

    I've set up my jnpl file so that it references a core jar file (contains main() function). The jnlp also references another jar file (app.jar) which contains class files that I load and instantiate dynamically (using ClassLoader). The core.jar file contains a manifest that includes a reference to app.jar.
    The app works fine when I use "java -jar core.jar" from the command line.
    However, when I wrap the jars using jnlp, I always get a null pointer exception because it cannot find any class that is in the app.jar file. I've tried different strategies, such as trying to load a class file that sits on the server (in a jar file and not in a jar file), but that also fails if I use jnlp (However, it works if I use "java -jar core.jar")
    Any ideas what is going on?

    This is the "OckCore.jar" manifest before signing:
    Manifest-Version: 1.0
    Main-Class: com.Ock.OckCore.OckApp
    Class-Path: . OckMaths.jar
    Created-By: 1.4.0-beta3 (Sun Microsystems Inc.)
    Name: com.Ock.OckCore.OckApp.class
    Java-Bean: FalseThis is the manifest after signing:
    Manifest-Version: 1.0
    Main-Class: com.Ock.OckCore.OckApp
    Created-By: 1.4.0-beta3 (Sun Microsystems Inc.)
    Class-Path: http://hazel/Ock/. http://hazel/Ock/OckMaths.jar
    Name: com/Ock/OckCore/OckApp.class
    SHA1-Digest: KRZmOryizx9o2L61nN+DbUYCgwo=I have removed a load of irrelevant stuff from the "after" manifest to keep it readable.
    note that :-
    The OckApp.class loads normally from webstart and tries to load a class from OckMaths.jar.
    I can prove that OckApp.class does load because it creates a log file when it does.
    The OckApp.class tries to load a class from the OckMaths.jar. This fails if webstart is used but works if OckCore is launched using "java -jar OckCore.jar".
    The jars do exist at the location specified by the manifest.
    The application launches normally if I use "java -Jar OckCore.jar"
    Here is the jnlp file
    <?xml version='1.0' encoding='UTF-8'?>
    <jnlp
         spec="1.0"
         codebase="http://hazel/Ock"
         href="OckMaths.jnlp">
         <information>
              <title>Ock Maths Demo</title>
              <vendor>Rodentware Inc</vendor>
              <description>Demo of a ported app running as a Java Webstart application</description>
              <description kind="short">An app running as a Java Webstart application"></description>
              <offline-allowed/>
         </information>
         <security>
              <all-permissions/>          
         </security>
         <resources>
              <j2se version="1.3"/>
              <jar href="OckCore.jar"/>
              <jar href="OckMaths.jar"/>
         </resources>
         <application-desc main-class="com.Ock.OckCore.OckApp">
    </jnlp> I have also signed the jars outside of a webdirectory. I get the following manifest file:
    Manifest-Version: 1.0
    Main-Class: com.Ock.OckCore.OckApp
    Created-By: 1.4.0-beta3 (Sun Microsystems Inc.)
    Class-Path: . OckMaths.jar
    Name: com/Ock/OckCore/OckApp.class
    SHA1-Digest: KRZmOryizx9o2L61nN+DbUYCgwo=
    note that :-
    The jars do exist at the location specified by the manifest.
    The application launches normally if I use "java -Jar OckCore.jar".
    The application doesn't launch from webstart.
    I've found that cache, but the jar files have been renamed.
    OckCore.jar is anOckCore.jar, etc... so I'm not sure if trying to write a cmdline will work anyway.

  • How can i debug a rfc being called from sap

    hello Gurus,
    We made a RFC call from SAP r3 to sap grc nfe......we did not receive any data in sap grc .......we go to SM58 and there it gives
    the message "Name or password is incorrect (repeat logon)u201D.
    How can i find out where the data has stuck.
    Please help.
    BR
    Honey

    HI,
    please have a look at the link below..
    this may help u !!!
    [Re: how can i debug a rfc being called from .net connector (NCO) v2.0?;
    Best of Luck !!1
    Regards
    Ravi

  • How to know whether the current database is using a password file or not?

    How to know whether the current database is using a password file or not?

    The remote_password_file is the parameter that determines if you can use or not a password file. The values this parameter can have are NONE, SHARED, EXCLUSIVE. It is pretty obvious, if it is set to either SHARED or EXCLUSIVE the oracle instance has enabled the access through a password file for the SYSDBA and SYSOPER roles.
    ~ Madrid

  • How do I access classes and methods defined in a wsdl file

    I have been provided a wsdl file I need to find out how do I access classes and methods defined in a wsdl file directly instead of doing a wsdl2java...

    Several comments :
    1- is there any reason to have blank chars inserted after the path ? Seems that you already have a problem there. If possible, try to solve the problem at the source
    2- the end of line char is usually CR (Carriage Return, aka ASCII char 13 = $0D = Control-D). But LF (Line Feed = 10 = $0A = control-A) is also used (platform dependent). In LV, you can use the "Concatenate strings" function to add/insert control chars (found in the String Control Palette). However, this will not solve your problem of unwanted added blank chars at the end of your string.
    3- you can use the Trim white space.vi (in the "Additionnal string functions" sub-palette) to remove ALL the spaces in your string
    4- you can build your own "end space remover" function. :
    reverse the string, wire to a "Match pattern" function, use " +" (space + "+") to search for any number of spaces, reverse again the "after substring".
    5- there is no point 5 :-)
    You may find interesting description of ASCII chars here
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Is it possible to load classes from a jar file

    Using ClassLoader is it possible to load the classes from a jar file?

    URL[] u = new URL[1] ;
    u[0] = new URL( "file://" + jarLocation + jarFileName + "/" );
    URLClassLoader jLoader = new URLClassLoader( u );
    Object clsName = jLoader.loadClass( clsList.elementAt(i).toString() ).newInstance();
    I get this error message.
    java.lang.ClassNotFoundException: ExceptionTestCase
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    // "file://" + fileLocation + fileName + "/" This works fine from a browser.
    Is there anything I am missing? Thanks for the reply.

  • When i do a backup to my computer, which things are being saved and which aren't?

    When i do a backup to my computer, which things are being saved and which aren't?

    You need more than one backup. Hard drives do fail. You can also try a clone.
    Clone  - Carbon Copy Cloner          (Often recommended as it has more features than some others)
    Clone – Data Backup
    Clone – Deja Vu
    Clone  - SuperDuper
    Clone - Synk
    Clone Software – 6 Applications Tested
    Commonly Used Backup Methods

Maybe you are looking for

  • Opening files on a Mac from a PC

    My company recently switched me from a PC to a Mac. I am having issues opening any InDesign file. I am not however experiencing problems opening any files on the other platforms (photoshop, illustrator, dreamweaver etc.). I am using the trial version

  • Weird Font Warning Problem

    Hi, When debugging my application in FB, I am getting the following warning when a certain component is loaded: warning: incompatible embedded font 'Arial' specified for spark.components::Label (Label172) . This component requires that the embedded f

  • PO or Stock Transfer Order

    Hi, We have One company with a plant and another company with a sales organization. Which is better      option between these - PO or Stock Transfer Order ? Thanks, Neelam.

  • All transfered songs not appearing

    I have moved songs from my itunes on my pc to my iphone 4s.  When I go to the iphone while it is plugged into the pc it shows the songs are there but when I go to my iphone they are not all there.  All the songs are from albums that I loaded into itu

  • JAVAOCR 1.0 is Released

    JAVA OCR recognizes characters from image. You can download demo at www.javaocr.com