Identify Java version from CLASS file

Hi,
I have a .class file. I would like to identify the Java version from that.
Is there a way to find out?
Also, is there a way to find out the Java version from JAR file?
Thanks.

Kavipriya wrote:
I have a .class file. I would like to identify the Java version from that.
Is there a way to find out?Sure, there's the major version number (48, 49, 50) included in the class files. Look for the class file specification, shouldn't be too hard to find.

Similar Messages

  • Java version from class file

    How to decide from class file that which java version (1.3, 1.4 etc) was used to compile it?

    Sorry I made a mistake,
    its minor, major
    Dont we have some utility given by Sun for this?
    javap -verbose <classname>will print out versions plus more...
    Do I need to use InputStream for reading class file then see the version?
    DataInputStream din = new DataInputStream(new FileInputStream(classFile));
    din.readInt();
    short minor = din.readShort();
    short major = din.readShort();Why do you need to do this?

  • Java version for class file

    i have some class files, and i need to know what Java compiler used to compiled that class file (only care for the version number...like 1.4.2, 1.5.0, 1.1.0, etc)
    any one know how i can get this info? or any good google keywords?

    thanx, since now i know how the class file bytes are set up..i guess i can get the version number by looking at the hex.
    tedious (but not that tedious)...thought there be a simplier way...oh well..
    thanx again

  • Can i generate java API from class files

    I have only class files. Is it possible to generate the java API using the javadoc.If yes, pls tell me how can i do??

    Also, Javadoc 1.4.2 will contain an unsupported option -Xclasses
    that should allow you to do this. You must pass in class names
    and use -classpath to find them. For com.package.MyClass
    at /home/classes/com/package/MyClass.class,
    you would run:
    javadoc -Xclasses -classpath /home/classes com.package.MyClass
    For mroe info, see:
    http://developer.java.sun.com/developer/bugParade/bugs/4720100.html-
    Doug Kramer
    Javadoc team

  • Only to import  JAVA CLASS  and JAVA SOURCE  from .DMP file using IMPDP

    hi,
    I have a schema X, In that schema some of the *"JAVA CLASS" and "JAVA SOURCE"* objects are missing ..
    The procedures ,functions..etc objects were updated at X schema..
    I have 1 dmp file of Y schema , containing the missing "JAVA CLASS" and "JAVA SOURCE" s.. Can I import the the same to the schema X using IMPDP
    i tried using INCLUDE clause but it is not working
    eg:
    impdp john1/john1@me11g22 directory=datadump dumpfile=DEVF2WAR.DMP remap_schema=devf2war:john INCLUDE="JAVA CLASS","JAVA CLASS"but error..
    ORA-39001: invalid argument value
    ORA-39041: Filter  "INCLUDE" either identifies all object types or no object types.regards,
    jp

    Double post: IMPDP to import  JAVA CLASS  and JAVA SOURCE from .DMP file
    Already replied.
    Regards
    Gokhan

  • Call function in main timeline from class file

    Hi all, How can a function in main timeline be called from class file?

    Hi all, How can a function in main timeline be called from class file?
    You can, but you really shouldn't.
    Classes shouldn't "talk" to the outside directly.
    Use Event dispatching to get things done.
    "root" (i just threw up by just typing that word) should be avoided at all cost, especially in AS3.

  • Issues exporting versions from tiff files

    I upgraded to Aperture 3 [3.0.2] running on 10.6. Aperture works fine, except when trying to export a version of a tiff file [these are 8 bit 200mb scans]. Exporting a master from a tiff file works, exporting versions from RAW files work, but Aperture "hangs" when trying to export a version of a tiff file. I do have access to the tiff versions when using the media browser in other applications (Pages, iWeb etc.).
    So far I tried all repair options [pressing cmd/ctrl while starting up] and i tried importing and than exporting a tiff file under Ap3, assuming something went wrong while updating from Ap2 to Ap3. Same results.
    ???

    can you provide your export settings. I tried it and it works...but my tifs are not 200mb.

  • Java Concurrent Program .class file location

    Hi frnds,
    I need to know the .class file location of a java concurrent prog. I know the filename from concurrent program executables and my concurrent program filepath is oracle.apps.xxogl.f04.cp.file. But I dont know where the exact location of the file is. pls help me.
    I searched for the same and found the following article in many places which doesnt seem to help me much.
    http://geektalkin.blogspot.com/2008/03/oracle-apps-java-concurrent-program.html
    pls help. thanks in advance.
    Lisan

    Hi;
    pls file can be found like
    /apps_st/appl/bom/12.0.0/patch/115/sql/
    Contains SQL*Plus scripts used to upgrade data, and .pkh, .pkb, and .pls scripts to create PL /SQL stored procedures.
    Regard
    Helios

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • EHS - CG36 - Import report - Set MSDS version from key file data

    Hi.
    This is in reference to thread EHS - CG36 - Import report - how to define MSDS version in key file?
    I'm faced with the same client requirement, came across this discussion, and wondering if there was a solution to this.
    I'm on ECC6.0. My client requests to retain the Version of the MSDS at the time of export (CG54 Dok-X, VER key file data) when it gets imported to another system (CG36). Example (similar to Roy's): If the reports in export system are 1.0 and 2.0, then they must be created in the import system the same, not 1.0 and 1.1.
    Apparently, as Christoph has stated, the standard CG36 Import process doesn't make use of the VER key file data besides storing it into the Report's Additional Info (DMS Class charact.).
    I tried to get around this via the user exit. In the IMPORT fm, I set the version/subversion of the report to be created but the C1F3 fm that does the actual report creation just ignores it. If you've done a similar approach, what have I missed? I'm also afraid if I have to clone the C1F3 fm...
    I appreciate your thoughts and inputs.
    Thanks in advance.
    Excerpt from my fm ZC13G_DOKX_SDB_IMPORT:
    FORM l_create_ibd_report...
      IF e_flg_error = false.
    *   fill the report_head
        e_report_head-subid     = i_subid.
        e_report_head-sbgvid    = i_sbgvid.
        e_report_head-langu     = i_langu.
        e_report_head-ehsdoccat = i_ehsdoccat.
        e_report_head-valdat    = sy-datum.
        e_report_head-rem       = i_remark.
    *beg-LECK901211-ins
        e_report_head-version    = i_ver.
        e_report_head-subversion = i_sver.
    *end-LECK901211-ins
    * Begin Correction 15.06.2004 745589 ***********************************
        IF ( l_api_subjoin_tab[] IS INITIAL ).
    *     create the report
          CALL FUNCTION 'C1F3_REPORT_CREATE'
            EXPORTING
              i_addinf            = i_addinf
              i_flg_header        = true
              i_flg_subjoin       = false
            IMPORTING
              e_flg_lockfail      = l_flg_lockfail
              e_flg_error         = l_flg_error
              e_flg_warning       = l_flg_warning
            CHANGING
              x_api_header        = e_report_head
            EXCEPTIONS
              no_object_specified = 1
              parameter_error     = 2
              OTHERS              = 3.
        ELSE.
    Edited by: Maria Luisa Noscal on Apr 8, 2011 8:23 AM

    Solution is to incorporate the logic used by tc CG36VEN, that is, the process of performing a direct table ESTDH update after the new report is saved into the database.
    Edited by: Maria Luisa Noscal on Apr 19, 2011 7:34 PM

  • Can I get jar version from class run from within jar ?

    I am launching a number of applets from a single jar file. I want to display jar file version on initial applet. I would ideally like the applet to be able to determine from the jar file which it was part of what version it is . Is this possible ?
    Applets are swing based & I'm using java plugin

    if your jar file has a manifest that specifies the version number, you can use java.util.jar.JarFile to get the information. Other wise, you would just have to induce it based upon the file attributes of the jar file, using java.io. Remember that applets can not, by default, read the local file system, so you might have to use signed applets.

  • Get Java Version from Applet to JSP

    Hi Forum!
    I am trying to collect client information with a jsp page and put the information into a html form.
    Besides the request information and some javascript screensize and flash version information I'd like to get the client's Java Version and Vendor with System.getProperty("java.version").
    I assume I can get this info only with an applet.
    How do I pass the Applet's version result to the JSP so I can view it with HTML and insert it into the form?
    Thanks a lot,
    Tom

    You would use liveconnect and the JSObject class to connect the Java code in the applet to JavaScript in the browser to populate the HTML:
    http://www.gsu.unibel.by/pub/javascript/ch19_06.htm
    http://www.apl.jhu.edu/~hall/java/JavaScript-from-Java.html

  • Change java version from 6 to 5

    Is there quick way to change from 6 to 5 and back?
    The only way I've known from this forum - is with help of Add/Remove Programs
    Thank you!
    Edited by: stopper on Feb 22, 2008 11:20 AM

    Well, this technique has always worked for me. Right now I have JDK 1.6.0_04 installed on the D: drive, and JRE 1.6.0_03 installed in the usual way, including the copies of those .exe files in the System32 directory. With my PATH set up as shown above, here's how the commands work: C:\>java -version
    java version "1.6.0_04"
    Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
    Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)
    C:\>C:\Windows\System32\java -version
    java version "1.6.0_03"
    Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
    Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing) I also have JDK 1.5 and 1.7 installed; when I want to test something under one of those, I use the fully qualified command: C:\>D:\Java\jdk1.7.0\bin\java -version
    java version "1.7.0-ea"
    Java(TM) SE Runtime Environment (build 1.7.0-ea-b19)
    Java HotSpot(TM) Client VM (build 1.7.0-ea-b19, mixed mode, sharing)

  • Last version of class file not called by Tomcat

    Hi,
    I'm a beginner in JSP/Tomcat.
    I would like to include as much java code as possible inside java classes and just call java methods from my JSP pages.
    For instance in project PCliente I've created the Java class
    /u5/web/jakarta-tomcat-4.1.27/webapps/ROOT/WEB-INF/classes/PCliente.java
    The class compiles successfully into PCliente.class which is stored in the same directory as the source.
    The first time I call the class from my JSP page it runs OK.
    The jsp page is in
    /u5/web/jakarta-tomcat-4.1.27/webapps/ROOT/pcliente/resultados.jsp.
    After I make some changes in PCliente.java, compile it, and run again the class from the JSP page, it doesn't get the last version of PCliente.class but a previous version. Also, I ignore where this previous version is kept (I assume Tomcat keeps a backup !? Where ?).
    Can someone please tell me what am I (or Tomcat or both) doing wrong ?
    I still have a serious handicap with Tomcat's configuration. A simple hint regarding this problem would be very apreciated.
    I'm using Tomcat 4.1.27 and J2SDK 1.3.1_9 installed in a Solaris environment.
    Thanks for your help,
    Miguel

    Hi,
    It sounds like your hitting the good ole rule that you need to restart the web application server (sometimes just a refresh will work, depends on the app server) when deploying new/updated classes.
    In short, if you restart Tomcat it should use the newer class...
    dapanther...

  • Getting Package Name From Class File Without Parsing File

    I am writing an application where I need to get the package name from a class file without parsing the class file itself.
    Basically, what happens is the user chooses a class file from anywhere in the file system. I then want to use reflection to get information about that class. To do that I need the fully qualified class name. I know that the package name is part or all of the path name but I don't know for sure which part it is. I don't want to parse the class file directly for the package name in case the class file spec is changed (that way I won't have to rewrite any code).
    Does Java have any way of getting this information without doing something stupid like gradually stripping off part of the pathname and trying it?

    The ClassLoader way seems to work fine, copy a class file to "A.class" and run this:import java.io.*;
    class ClassLoaderExample {
        public static void main(String[] args) throws Exception {
            class MyClassLoader extends ClassLoader {
                public Class load() throws IOException {
                    File f = new File("A.class");
                    byte[] classData = new byte[(int) f.length()];
                    new RandomAccessFile(f, "r").readFully(classData);
                    Class loaded = defineClass(null, classData, 0, classData.length);
                    resolveClass(loaded);
                    return loaded;
            Class c = new MyClassLoader().load();
            System.out.println(c);
            System.out.println(c.newInstance());
    }

Maybe you are looking for