JAR file JDK version

I have a question that i want to ask for a long time. Let say someone give you a jar file, how do we check which version of JDK it is compile ?

You can get an easy, but approximate, answer by looking in the jar manifest:
$ jar -xf somejar.jar META-INF/MANIFEST.MF
$ cat META-INF/MANIFEST.MF
Manifest-Version: 1.0
Class-Path: someotherjar.jar
Created-By: 1.6.0 (Sun Microsystems Inc.)
Main-Class: Main
The Created-By attribute says which JDK version created the jar file. However, that's not always the same as the version that was used to compile the classes. To get an exact answer, you'd need to look at the class file version number, and you'd have to do it for each class file since they don't all have to be the same. Gory details left as an exercise. Here's a reference to get you started:
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#80959

Similar Messages

  • How can i find the jar file version in Solaris

    Hi,all.
    I just forget the java command by which i can know a jar file's version.I searched the jar command manual,unfortunately there is nothing helpful.
    Can anyone tell me what should i do?
    Thanks in advance.

    I'm not sure that there is any version information related to a JAR file. And if you look at the JAR classes in the API docs, there is nothing related to the version. There can be a version number in the MANIFEST though, but not related to the JAR itself.

  • Manifest for jar file

    hi i create an jar file
    Manifest-Version: 1.0
    Main-Class: com.IR.IRoom
    Class-Path: classes12.jar aqapill.jar aqapi.jar aqapi60.jar art.jar arutil60.jar atli2.jar atli2_ip.jar atli2_ip_cio.jar bsh.jar codeset.jar commons.jar commons_httpclient.jar commons-lang-1.0.jar commons-logging.jar commons-net-1.1.0.jar
    i have two question now.
    when i jar this it give me error "line too long " bcz i have some more jars in it.
    second could i mention any folder which have jars file in classpath
    like Class-Path:include/*.jar
    regards

    Have you seen this recent thread: http://forum.java.sun.com/thread.jspa?threadID=689987&tstart=0
    There is a limit of 72 bytes (not chars!) per line in a manifest. YMMV, but you should be using Ant.

  • Need help with Jar file

    I am writing an Application in Java using swing and all that good stuff but I am currently ready to do some beta testing to find any other errors.
    The problems is I want it to be easy to use so I was just going to throw the classes ina jar file so they could just run the jar files.
    For some reason I keep getting a cannot find main class error??
    Here is the manifest file for the Jar file
    Manifest-Version: 1.0
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    Main-Class: VRPServer.class
    VRPServer is the class that has the main in it.
    if I go to the command line and run I get
    E:\JAVA\VRP\Server>java -jar VRPServer.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: VRPServer/class
    if I double click the jar I get a pop-up saying "Could not find the main class, program will exit."
    I really don't understand Jar files all that well, I went through the tutorials but still can't see why this isn't working. Any help is appreciated. :)

    I think your problem is that you shouldn't add the '.class' to the name of your main class in your manifest; it should simply be the fully-qualified name of the class, for example:
    Manifest-Version: 1.0
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    Main-Class: mypackage1.mypacage2.MyClassHope this is all it takes.
    Shaun

  • Jar file , which jdk version ?

    I have a question that i want to ask for a long time. Let say someone give you a jar file, how do we check which version of JDK it is compile ?

    You can get an easy, but approximate, answer by looking in the jar manifest:
    $ jar -xf somejar.jar META-INF/MANIFEST.MF
    $ cat META-INF/MANIFEST.MF
    Manifest-Version: 1.0
    Class-Path: someotherjar.jar
    Created-By: 1.6.0 (Sun Microsystems Inc.)
    Main-Class: Main
    The Created-By attribute says which JDK version created the jar file. However, that's not always the same as the version that was used to compile the classes. To get an exact answer, you'd need to look at the class file version number, and you'd have to do it for each class file since they don't all have to be the same. Gory details left as an exercise. Here's a reference to get you started:
    http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#80959

  • How to determine the JDK version required to use a jar?

    Hi all.
    I am using a hosted server that uses JDK 1.4.2 and I cannot upgrade the VM. I have been finding it extremely difficult to install web applications on this server since I find that after installing the app, the web server complains the bytecode used in the jar is newer than the VM can understand (or it complains that the app uses JEE servlet or JSP methods it cannot find).
    To compound the problem, only about 25% of the sites I've visited that provide jars for download mention the minumum JDK version required to use them. (Some do not mention any system requirements at all besides 'requires Java and a Java application server').
    Do any of you know of any tools that can analyze a jar and determine the bytecode version it uses?
    (Another helpful tool would be one that can determine the minimum JEE APIs required to run a web app..., but that's probably wishful thinking :)).
    Thanks for your help.
    Michael N. Christoff

    The major/minor version of the class file is the way to go.
    Also, it's not necessary to write a separate program to get to those. javap prints them out when being passed the -v flag.
    Note, however that "JDK version" is not a correct term, as I can create 1.4-compatible class files with a Java 6 JDK (by passing the -target flag to javac). Those won't look any different than .class files written with a 1.4 JDK.

  • JAR files just won´t run, multiple systems, JRE & JDK installed.

    Hi!
    I´ve been looking on many different places for an answer for this issue:
    I have to run different JAR files for applications, one is from Apache ActiveMQ, and the other is a hash calculating app. I´ve read on many topics that if you get error "Failed to load Main-Class" when running a JAR, the problem is how the JAR was packed (MANIFEST). Well, I find highly unlikely that two different JARs, from different sources, are wrongly packed. Also, I´ve installed JRE, JDK and even Java EE, on MS Server 2003 and on Windows 7 (on this last one only JRE), and no JAR runs. I´ve tried declaring PATH and JAVA_HOME environment variables... no use. Can anyone help me solve my problem?

    Hi,
    You might want to look in your control panel for 'Java' icon. It should give you an option to enable java plugin into your browser. Let me know if you still face the issue.
    Thanks!

  • How do you know the version of a JAR file ?

    how do you know the version of a JAR file ?
    is it what is written on MANIFEST.MF ?
    for example i have a JAR file
    whose MANIFEST.MF has this
    Manifest-Version: 1.0
    Created-By: Ant 1.4.1so, whats the version of this JAR ? 1.0 ?

    anyway, that was JSTL..jar.
    Now, come to another JAR file....
    whose MANIFEST.MF has......
    Manifest-Version: 1.0
    Created-By: Apache Ant 1.5.1
    Extension-Name: Struts Framework
    Specification-Title: Struts Framework
    Specification-Vendor: Apache Software Foundation
    Specification-Version: 1.1
    Implementation-Title: Struts Framework
    Implementation-Vendor: Apache Software Foundation
    Implementation-Vendor-Id: org.apache
    Implementation-Version: 1.1
    Class-Path:  commons-beanutils.jar commons-collections.jar commons-dig
    ester.jar commons-logging.jar commons-validator.jar jakarta-oro.jar s
    truts-legacy.jarso, How do you believe whats the version now ? do u go with the comment "Manifest-Version: 1.0" or "Specification-Version: 1.1" ?
    definitely, you would go with the "Specification-Version: 1.1" and declare this JAR as STRUTS 1.1
    hmmm, so, if nothing is mentioned like above should we follow the MANIFEST version as the JSTL version ? in my earlier example i did not find any comment on ""Specification-Version" ......so , if anybody gives me that JAR , how do i decide whether its 1.0 specification or 1.1 specifucation compliant ?
    can you tell whats the JSTL version of my earler example JAR file ?

  • Jar file in applet not saved in internet files when using jdk plugin

    Hello,
    I recently upgarded to jdk1.3.1 and converted our applet and classes to jdk1.3.1 using swing classes. From there, we converted the html file with htmlconverter and diployed this on the web. When a user goes to the web, the system automatically downloads the java plugins and installs them on the clients maching. From there our jar file loads and executes. Our applet runs fine. However, every time our website is accessed, our jar file cookie must be downloaded which is just over 1meg and I know this is not going to fly with our clients.
    What needs to be done so the jar file is not downloaded every time, to work like java version 1.x ?
    Thanks for your help in advance with this one.
    Jay Ford

    Hi Jay Ford,
    Enable the "Recycle Classloader" in Control Panel-->Java Plug-in1.3.1-->Basic.
    The main purpose of this Recycle classloader is it will enable the "javaplugin.classloader.cache.enabled" property to true and it caches the jar files for performance enchancement.
    Hope this will help you.
    Anil.
    Developer Technical Support,
    Sun Microsystems Inc,
    http://www.sun.com/developers/support

  • How to check the JDK version of a compiled java file

    can anybody tell me how to check the JDK version of a compiled java file ?
    Edited by: gbhatia8 on Sep 9, 2010 7:04 AM

    The major/minor version of the class file is the way to go.
    Also, it's not necessary to write a separate program to get to those. javap prints them out when being passed the -v flag.
    Note, however that "JDK version" is not a correct term, as I can create 1.4-compatible class files with a Java 6 JDK (by passing the -target flag to javac). Those won't look any different than .class files written with a 1.4 JDK.

  • Versions of ESS MSS business packs n about JCO jar file

    Hi Frndz..
    1)I want to know the versions of ESS n MSS busines pack
    2)Is there any jar file required while configuring JCO, if yes tell the name n use of that jar file
    Regards
    Rajesh
    09985516859

    Hello Rajesh,
    The versions are:
    ESS Business Pack 1.0 (Portal Content)
    ESS Business Pack 600 SP11 (Webdynpro Code)
    MSS Business Pack 1.0 (Portal Content)
    MSS Business Pack 600 SP11 (Webdynpro Code)
    There is no Jar file required in configuring jco's
    Regards,
    Shikhil

  • Jar file downloaded still the old version

    If I update a new jar file in the web server, The jar file being downloaded by a remote pc is still the old jar file even if the java plugin cache has been deleted. In my source below, I have already specified applet option as plugin.
    Below is the source code for applet caching:
    Hope someone could help thanks
    <OBJECT
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width="0" height="0" align="baseline" codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
    <PARAM NAME=<%=IboReserved.SCREEN_BUILDER%> VALUE="com.weserv.ibo.gui.InternetBanking">
    <PARAM NAME="trxcode" VALUE="0">
    <PARAM NAME="langind" VALUE="en">
    <PARAM NAME="country" VALUE="US">
    <PARAM NAME="code" VALUE="McpgApplet.class">
    <PARAM NAME="codebase" VALUE="http://mcpgdev.bancnet.net/apps">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    <PARAM NAME="cache_archive" VALUE="<%= appletArchive %>">
    <PARAM NAME="cache_version" VALUE="<%= appletVersion %>">
    <PARAM NAME="cache_option" VALUE="Plugin">
    <COMMENT>
    <EMBED type="application/x-java-applet;version=1.3"
    width="0" height="0" align="baseline"
    code="McpgApplet" name="mcpgApplet" codebase="http://mcpgdev.bancnet.net/apps"
    pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html">
    <NOEMBED>
    </COMMENT> No Java 2 support for APPLET!! </NOEMBED>
    </EMBED>
    </OBJECT>

    download the zip file unzip it under windows install the drivers you need upgrading
    thats what I did and it updated my video card driver so windows stopped crashing

  • Ess_japi.jar files for Essbase 11x version

    Hi All,
    We are working on upgrade Essbase upgrade from 7x version to 11x and found there is an ess_japi.jar file which is being used for Web based application.
    Do we need to get the new version of the JAR files for the 11X version?
    Thanks and regards
    Pancha

    Hey John,
    I am newbie to Essbase and when i was going to all the configuration files we found that these Jar files are being deployed in the EDS folders and was just curious when are installing the ESSBASE version 11x.. EDS folder and also associated files also get loaded into server?
    Thanks for your reponse.

  • Unsupported class version error trying to run jar file on windows machine

    Hi,
    i've written a program that connects to an access database to get its data. Created a jar file with the class files, the access database and other required files.
    works fine on my home windows computer but when i try to run it on another machine i get an error.
    here's what i write on the cmd: java -Xmx128m -jar myFile.jar
    heres the error i get:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: StartUp(Unsupported major.minor version 49.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    and so on.
    It seems like it might be quite a basic error but i'm lost, can anyone please shed some light and tell me where i'm going wrong?
    cheers in advance

    hey there, in case anyone was going to reply, i've worked it out now. couldn't work out what was wrong at first so just pulled out all my classes and put them into a brand new jar file. now use javaw -jar instead of java and it worked fine! wierd...

  • Can anybody provide type 4 jar file for oracle 9i + jdk 1.5

    Hello,
    I want to connect my java application(jdk 1.5) to oracle.Can any body provide the jar file for that one and whre I want to put that jar file.Please send me one sample code for jdbc connection to oracle for calling a stored procedure in oracle.
    Bipin.V

    Wouldn't it be easier to google on e.g. oracle jdbc download?
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    Kaj

Maybe you are looking for

  • Beginners Guide sound installation -- OSS and ALSA objective features

    Beginners Guide sound installation -- OSS and ALSA objective features needed Hi, In most wiki pages i just edit the things that i think need editing. Just look at the oss history In all those cases i didn't really saw a need to ask for permission.. t

  • User exit or BADI for MIGO to Update a field in MSEG-KOSTL

    Hi, I want to update/change the KOSTL (Cost center) value before creating/posting  the document. Please let me know is there any user exits or BADI,  which will export the MSEG structure. Regards, Ganesh

  • Retrieving Checkbox Value and Displayong it in table column

    Hi Friends, It's an urgent query,please solve it asap I am having three colums which are having data(Country,State,City) and fourth column contains checkbox when i check the checkbox, i want all three values to be diplayed on th .jsp page in three di

  • How to upload the file without using java components?

    Hello, I need to upload the file using JSP, but I don't want to use java componets(such as jspsmart). Who can tell me how to realize it? This issue is very important to me, thanks all in advance!

  • Shoulda thought of this before I built my site...

    I've built this lovely Flash site that shows information on our company's projects by loading a .swf file into the main index page each time that project info is requested by a button click. There are not separate html pages for each .swf file to dis