How to verify existence/absence of debug information in a jar file

Given a jar, how can I tell if it contains debug information or not? Is there a tool for this? (e.g, like the 'file' utility on linux, which outputs whether an ELF executable is stripped or not)
Amit

I'm not saying it's pretty... but there's a horrible quick & dirty way of checking for debug info
Typically the debugging information is stored is special attributes in the class files, like "LineNumberTable", "LocalVariableTable" etc.
Depending on which type of debugging setting was used to compile the source code, these will be present in the binary class file.
So, you might unjar the contents of the jar and run eg.
find "LineNumberTable" *.class
to find all classes with line number information.
I tried it on a sample class and it worked for me here.
Hey, I know it's a hack, but not everyone has time to write a full disassembler !
regards,
Owen

Similar Messages

  • 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.

  • JNI: How to use FindClass to get a class in a Jar file?

    Is it possible to use the FindClass method of the JNI environment object to get a class that is in a jar file? My sample application was working when my class files were in the local directory. Now that I have replaced the class files with a jar file containing the classes, the app no longer works. I'd appreciate tips from anyone who knows how to do this.
    -Andreas

    Is it possible to use the FindClass method of the
    JNI environment object to get a class that is in a
    jar file? My sample application was working when my
    class files were in the local directory. Now that I
    have replaced the class files with a jar file
    containing the classes, the app no longer works. I'd
    appreciate tips from anyone who knows how to do this.It has nothing to do with JNI.
    The method uses the class path just like any other class loading situation in java. The reason it worked before is because your class path included the directory. It doesn't work now because either the jar is not in the class path or there is something wrong with the class path.

  • Dont ask why! How do I call an applet that is in a jar file that is...

    Can someone tell me how I would call an applet that is inside of a jar file that is inside of a parent jar file?
    example call to an Applet
    <APPLET CODE="TimeApplet" ARCHIVE="time.jar" />what I want to do is something like
    <APPLET CODE="TimeApplet" ARCHIVE="parent.time.jar" />
    where parent is the top jar and time is the inner jar.any help or links to tutorials/articles would be most appreciated.
    if you ask why I wont answer.

    we are doing a signed applet and we only want the user to have to sign 1 time
    and we have lots of applets to display so we dont want to have them sign for
    each item.Sorry but that doesn't make much sense, niether does putting a jar file in a jar file.
    Do you want the "do you trust" question only one time? If so than you only have
    to sign all the jar files with the same key.
    You can load a jar file from your applet but it seems that these jar files will run
    in sanbox security no matter how you sign it:
    http://forum.java.sun.com/thread.jspa?messageID=3582952
    Asking why does make sense, I coud be asking how to climb a building without
    telling my objective is to get on the 10th floor.
    You would tell me how to climb the building an I'd probably do it and find out
    later I could just as well have taken the elivator.

  • How do I read the images I bundled into the jar file?

    I just wrote an applet that uses
         Toolkit tk = Toolkit.getDefaultToolkit();
         tk.getImage("blah.gif");to load a bunch of image files. The class file and gif images were bundled into a jar file to minimize the number of connections the browser has to make to the server.
    The applet works fine in appletviewer but trips a java.security.AccessControlException: access denied (java.io.FilePermission select.gif read) when run in a browser. I know you normally use Applet.getImage(URL) to load images but wont that circumvent the JAR file and make a seperate connection to the server for each image? That would defeat the purpose of using a JAR file.
    How do I access the image files I bundled into the JAR file?

    From your Applet class, write the following:
    URL imgUrl = getClass().getResource("blah.gif");
    Image img = getImage(imgUrl);The returned URL will be from the Applet class ClassLoader, which will look into the specified archive (jar) file.

  • How do I do a runtime debug of a Coldfusion component file?

    My application has a Coldfusion component(cfc), CFM file and a lot of Flex source files.
    I tried using  <cftry>,  <cfcatch>, <cfdump> to find the errors in the cfc, but still cannot trace the issue.
    The code in CFC file is somewhat like
    <cfcomponent>
        <cffunction name="edit" access="remote" returntype="any">
            <cfargument name="form_data" type="struct">
            <cftry>
                <cftransaction>
                    <!--- Update Record --->
                    <cfquery datasource="#Application.ds#">
                        some SQL here
                    </cfquery>
                     <!--- Remove all previous outcomes --->
                    <cfquery datasource="#Application.ds#">
                        some SQL here
                    </cfquery>
                    <!--- Log Update --->
                    <cfquery datasource="#Application.ds#">
                        some SQL here
                    </cfquery>
                    <!--- Get Last Logged Record --->
                    <cfquery datasource="#Application.ds#" name="getLogLastRecord">
                        some SQL here
                    </cfquery>
                    <cfloop index="arr_index" from="1" to="#ArrayLen(form_data.num)#">
                        <!--- Update Record --->
                        <cfquery datasource="#Application.ds#" >
                            some SQL here
                        </cfquery>
                        <!--- Log Update --->
                        <cfquery datasource="#Application.ds#" >
                            some SQL here
                        </cfquery>
                    </cfloop>
        </cftransaction>
                <cfset result['statMsg']= "The record was saved successfully!">
                <cfset result['status']= true>
                <cfcatch><!--- Catch error --->
                    <cfsavecontent variable="contentSaver">
                         <cfdump var="#form_data#">
                         <cfdump var="#cfcatch#">
                    </cfsavecontent>
                    <cffile action="write" file="#ExpandPath('.')#\debug.html" output="#contentSaver#">
                    <cfset result['statMsg'] = cfcatch.Message>
                    <cfset result['status']= false>
                </cfcatch>
            </cftry>
            <cfreturn result>
        </cffunction>
    </cfcomponent>
    Issue: 1 My understanding is if the transaction is successful I should get the message "The record was saved successfully!" which I don't get, though the transaction is successful as the data is saved in the MySQL backend.
    Even if the transaction failed, I should get a message due to the catch block.
    What could be the reason I am not getting the message? The users of the application need to get this so that they know that the changes they did are saved.
    Issue 2: For another transaction, I get the below message at run time.
    "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@domain.com' at line 3"
    The transaction goes through fine and changes are saved to the back end database which means nothing is wrong in my SQL syntax.
    I don't see anything wrong on line 3 of the cfc file, nor the third line of the SQL statement has anything missing. Why am I getting that message?
    Why am I not getting a message when I should for Issue 1 when the transaction is successful and why am I getting a strange error message for Issue 2 though the transaction is successful?
    Can I do a run time debugging of the CFC using Coldfusion Builder as I can for Flex source files using Flexbuilder?
    Any advice would be welcome.

    hemant_k wrote:
    Yes, you can use debugger in ColdFusion Builder. Check http://help.adobe.com/en_US/ColdFusionBuilder/Using/WS0ef8c004658c1089 -31c11ef1121cdfd6aa0-7fff.html for some details.
    There are some interesting link around builder available on CF builder team blog - blogs.adobe.com/cfbuilder. [image links are not working becuase of admin issues]
    Thanks, that link is helpful.

  • How do I identify all of the methods in a .jar file?

    I'm compiling a small java application that includes two .jar files in the classpath. Is there any way I can identify all of the objects and methods in the .jar files?

    I'm compiling a small java application that includes
    two .jar files in the classpath. Is there any way I
    can identify all of the objects and methods in the
    .jar files?Well if you are wanting a java program to do this, you could use the zip utils in java.util.jar package. Get a list of the entries and use refelction to get a java.lang.Class object for each entry. Then you can use the .getMethods() method of the Class object to get an array of java.lang.reflect.Method objects. Loop though the arrays and there you go.

  • 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

  • Studio 10 cannot get debugging information for main

    Hi all,
    Running Build 20040805 of Studio 10 on Solaris 9.
    I cannot get the debuging info for the main routine.
    I think the issue is related to the fact that the Fortran runs in a Perl wrapper, which renames the executable. It did also create a new directory for the run, but we have suppresed that.
    Any ideas?
    Andrew

    Try using the "pathmap" command in dbx to point to the
    directory where the .o files are. Normally, dbx will find
    look in the a.out to find a path to the .o files. Then it will load
    debugging information from the .o files.

  • How to authenticate a JWS Client download of jar files on a web server

    Here is a history of how i tried to implement the auth system:
    The resources(jar files) cannot be downloaded by any HTTP client from the server without some authentication method.
    As JWS is not reliable when using cookies (only 1.5 supports them, but with problems when in JNLP file i specify j2se version=older that 1.5) , i implemented another mecanism that works like this:
    1. 1.The template JNLP looks like this
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp codebase="http://10.3.0.62/" href="mapped/#JWS_CODE#___#PLATFORM#___app2.2.jnlp">
        <information>
           bla bla
        </information>
        <security>
            <all-permissions/>
        </security>
        <resources>
            <j2se version="1.4"/>
            <jar href="http://10.3.0.62/mapped/gui.jar?jwsid=#JWS_CODE#" version="2.2"/>
            <jar href="http://10.3.0.62/mapped/data.jar?jwsid=#JWS_CODE#" version="2.2"/>
            <jar href="http://10.3.0.62/mapped/log4j.jar?jwsid=#JWS_CODE#"/>
        </resources>
        <application-desc main-class="com.bet.blues.gui.Application">
            <argument>-host</argument>
            <argument>ursus</argument>
            <argument>-port</argument>
            <argument>17771</argument>
        </application-desc>
    </jnlp>2. All resources found in /mapped/ directory are mapped to JWSServlet
    3. The users login to a site , clik on link , /mapped/app2.2.jnlp , the servlet checks if the session is active , gets the PLATFORM form browser request header , gets the JWSCODE for the logged user, replaces this in the template, and returns it to the client
    4.Now after the 1st download the JNLP file is opened by JWS Client , that checks for latest version , requesting the JNLP file again
    like this:
    GET http://10.3.0.62/mapped/f12ks21092___windows___app2.2.jnlp5.Now the servlet sees the the request has a JNLP file name with an ID and PLATFORM, and serves the JNLP as before
    6.The JWS Client will request for JAR Files
    GET http://10.3.0.62/mapped/gui.jar?jwscode=f12ks21092?version-id=2.2Note: that i have forced JWSID parameter in the URL, that's why the query string contains 2 "?"
    - forcing this is because the mapped/*.jar is redirected JnlpDownloadServlet that supports versions , diffs - i cannot use 'version' to put there the jswid param(e.g .../mapped/gui.jar version="fk12ks21092_2.2" because the JnlpDownloadServlet will not find this version , and if JWS Servlet will redirect to JnlpDownloadServlet with correct version param in request, the JWS Client will raise an exception because version responded is not right(JNLPDownloadServlet marks in response HTTP header the version of the jar so JWS CLient will chek it)
    JWS Client expects version 'fk12ks21092_ver2.2'; to correct this i should modify the JnlpDownloadServlet and i shouldnt
    THE PROBLEM :
    on older versions than 1.5 JWS Client raises an exception because it wants to create a temp file named
    " gui.jar?jwscode=f12ks21092" because it contains "?"
    Only with 1.5 that seems to parse the jar name until it meets "?" char :(
    Thats why i wanted to send an error to the client to upgrade to Java Web Start 1.5
    Now, maybe u have a solution to this problem...
    All i want is a solution to let JWS Client download jars only if the user is authenticated by some mecanism....and also support the versioning system.
    Also:
    Note that the jar names must preserve on the client JWS Cache dir ( i cannot use the same method to pass the JWSCODE when requesting the JARS as when requesting the JNLP).

    You need to look into JAAS

  • Trying to login to software program known as hamspher (vip simulated ham radio,  it downloaded the program but it will not allow me to login with call sign and pin.  it has to be opened with what they call a jar file.  how do i do this?

    trying to login to software program known as hamspher (vip simulated ham radio,  it downloaded the program but it will not allow me to login with call sign and pin.  it has to be opened with what they call a jar file.  how do i do this?

    This is compatible with Mac? Especially Snow Leopard (if that is what you'e running)?
    Have you considered posting your question in their forums?
    Here is some information re. the jar file:
    http://ostermiller.org/opening_jar_files.html

  • How to list the JAR files loaded into the Oracle Database ?

    How to list the JAR files loaded into the Oracle Database ?

    From 11.1 onwards, the below two views are available to identify the jar files loaded into the Database.
    JAVAJAR$
    JAVAJAROBJECTS$
    By querying the JAVAJAR$ view you can know information about the JAR files loaded into the Database and using JAVAJAROBJECTS$ view you can find all the java objects associated with the given JAR file.
    These views are populated everytime you use LOADJAVA with "-jarsasdbobjects" option to load your custom java classes.
    But unfortunately this feature is available only from 11.1 onwards and there is no clear workaround for above in 10.2 or earlier.

  • How do I import classes in a jar file?

    I have the following directory structure, each directory is a seperate package of the same name as the directory
    RPGUniversal
    RPGMap
    RPGCharacter
    RPGCharacter is not done yet so I am ignoring that package for now.
    RPGCharacter and RPGMap both depends on classes inside the RPGUniversal Package, but are independant of eachother and RPGUniversal is completely independant.
    I want to place each package in it's own .jar file for use as a library in later programs.
    I placed all the compiled classes for RPGUniversal inside the proper directory structure, I then used this command to place it in a jar:
    jar -cf ./RPGUniversal.jar ./RPGUniversal/*
    I then tested the contents with this command:
    exodist@Abydos:/stuff/JProject/test$ jar -tf RPGUniversal.jar
    META-INF/
    META-INF/MANIFEST.MF
    RPGUniversal/ADTs/
    RPGUniversal/ADTs/t1.jpg
    RPGUniversal/ADTs/t2.jpg
    RPGUniversal/ADTs/t3.jpg
    RPGUniversal/ADTs/t4.jpg
    RPGUniversal/ADTs/Coordinates.class
    RPGUniversal/ADTs/RPGImage.class
    RPGUniversal/ADTs/FrameSet.class
    RPGUniversal/ADTs/ImageTester.class
    RPGUniversal/Exceptions/
    RPGUniversal/Interfaces/
    RPGUniversal/Interfaces/RPGCharacter.class
    RPGUniversal/Interfaces/RPGItem.class
    RPGUniversal/Interfaces/RPGObject.class
    RPGUniversal/Interfaces/Trackable.class
    RPGUniversal/Interfaces/Tracker.class
    RPGUniversal/Interfaces/RPGMapComponent.class
    RPGUniversal/Interfaces/RPGMap.class
    so far all good, next I delete the RPGUniversal directory leaving the only file in the current directory RPGUniversal.jar
    next I create the RPGMap directory and give it the proper .java files and directory tree.
    I then run a script to compile every .java file
    for i in `find ./ -name "*.java"`; do javac "$i"; done
    and I get a ton of dependancy errors:
    exodist@Abydos:/stuff/JProject/test$ for i in `find ./ -name "*.java"`; do javac "$i"; done
    ./RPGMap/BaseClasses/StaticMap.java:13: package RPGUniversal.Interfaces does not exist
    import RPGUniversal.Interfaces.*;
    ^
    ./RPGMap/BaseClasses/StaticMap.java:20: cannot resolve symbol
    symbol : class RPGMap
    location: class RPGMap.BaseClasses.StaticMap
    public abstract class StaticMap implements RPGMap
    ^
    ./RPGMap/ComponentClasses/MapTile.java:9: package RPGUniversal.Interfaces does not exist
    import RPGUniversal.Interfaces.*;
    ^
    ./RPGMap/ComponentClasses/MapTile.java:10: package RPGUniversal.ADTs does not exist
    import RPGUniversal.ADTs.*;
    ^
    ./RPGMap/ComponentClasses/MapTile.java:16: cannot resolve symbol
    symbol : class RPGObject
    location: class RPGMap.ComponentClasses.MapTile
    public class MapTile implements RPGObject
    ^
    ./RPGMap/ComponentClasses/MapTile.java:19: cannot resolve symbol
    symbol : class RPGImage
    location: class RPGMap.ComponentClasses.MapTile
    private RPGImage MyImage;
    ^
    ./RPGMap/ComponentClasses/MapTile.java:31: cannot resolve symbol
    symbol : class Coordinates
    location: class RPGMap.ComponentClasses.MapTile
    public boolean CheckForCollision(Coordinates C)
    ....the list goes on........
    how do I tell it to look inside the RPGUniversal.jar file to find the required classes?
    here is a directory tree so you can see how it is set up:
    ls -R1
    RPGMap/
    RPGUniversal.jar
    ./RPGMap:
    BaseClasses/
    ComponentClasses/
    ExternalInterfaces/
    HigherClasses/
    InternalInterfaces/
    ./RPGMap/BaseClasses:
    StaticMap.java
    ./RPGMap/ComponentClasses:
    MapTable.java
    MapTile.java
    TableList.java
    TileSet.java
    ./RPGMap/ExternalInterfaces:
    ./RPGMap/HigherClasses:
    DynamicMap.java
    ./RPGMap/InternalInterfaces:

    The JAR file needs to be in the compliers classpath : javac -classpath "$CLASSPATH:RPGUniversal.jar" "$i"

  • How to verify the user information pass by the form with a stored procedure?

    Hi,
    I would like to know how to verify user information pass by the form with a stored procedure.
    I want make a portal which accepts to new user registration, but I want verify the new user's informations (like the name don't contain a number etc).
    Thanks for your help
    regards
    jla

    Hi Samson,
    You can use the UI API to do this. You can catch the form_ADD event and then validate the input from the users. You can even block the event from completing (and stop the document from being added) if your code finds some incorrect data using the bubbleEvent functionality.
    I don't have one specific example to show you, but if you look at some of the SDK samples (for example C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\02.CatchingEvents) to see how to work with events, you can then create your own validation to ensure the users data is valid.
    Regards,
    Niall

  • How to determine if class was compiled with debugging information?

    How may I determine if class was compiled with debugging information? Aside from actually executing the class in a debugger.

    As known, when compiling "javac -g ..." the class
    files contain debugging information.
    my Naive question is WHAT is this information?
    could you please add any links to articles about this
    debugging information?http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#22856
    http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#5956

Maybe you are looking for

  • OSB DB Adapter Polling Issue

    Hello Everybody, Requirement I am doing DB Adapter polling in OSB.I have a db adapter which polls order table whenever there is a record with status='N'.The OSB component is on single node of Weblogic Server. 1.The db adapter picks the order data wit

  • Reversed documents are not cleared

    Hello there I am dealing with support to customer who has following issue (among others..): - the settings are made so that standard SAP reversing procedure is messed up! Namely, when the user reverse FI document the SAP creates new one (reversal doc

  • Drawing/outline/stroke

    i'm wondering if there is a way to have an effect similar to a "stroke" which i can apply to a drawing which was originally made in photoshop with the paintbrush tool. In other words, I've imported my drawing into after effects...(.Lets say it's an o

  • What version of iMovie can I download for mac os x 10.8.5? (and where?)

    Hi, Can someone please tell me what versions my Mac will support and were I can download it from? Thank you Chris

  • Getting java.lang.AssertionError: No endpoints build for /wsdls/WSDLFile.ws

    I am using Weblogic Workshop 9.2 I have to create a new Web Service in which need to use XML over HTTP binding. I have done the following: 1. I have created my own Schema and validated it. 2. Created my WSDL file and validated it - No issue in WSDL b