Finding java version used from compiled code

Is there a way to find the java version used to compile the java file from the compiled files,i.e., class files?

that information is encapsulated within the .class file, I don't think so.
The class file has a minor_version/major_version field.
However using jikes and sun jdk 1.3.1 both produce a version number of 45.3. According to a footnote in the JVM spec that corresponds to a class file format for java of 1.0.2. And both obviously are newer than that version of java.
Based on that I don't think one can expect those numbers to changed based on the java version but rather on any changes in the class file itself.

Similar Messages

  • [svn:osmf:] 14357: Moved constants for namespace ( also added a version number to the namespace) and the metadata key to the MASTPluginInfo class so these constants can be used from player code .

    Revision: 14357
    Revision: 14357
    Author:   [email protected]
    Date:     2010-02-23 09:41:57 -0800 (Tue, 23 Feb 2010)
    Log Message:
    Moved constants for namespace (also added a version number to the namespace) and the metadata key to the MASTPluginInfo class so these constants can be used from player code.
    Modified Paths:
        osmf/trunk/plugins/MASTPlugin/org/osmf/mast/MASTPluginInfo.as
        osmf/trunk/plugins/MASTPlugin/org/osmf/mast/media/MASTProxyElement.as

    Revision: 14357
    Revision: 14357
    Author:   [email protected]
    Date:     2010-02-23 09:41:57 -0800 (Tue, 23 Feb 2010)
    Log Message:
    Moved constants for namespace (also added a version number to the namespace) and the metadata key to the MASTPluginInfo class so these constants can be used from player code.
    Modified Paths:
        osmf/trunk/plugins/MASTPlugin/org/osmf/mast/MASTPluginInfo.as
        osmf/trunk/plugins/MASTPlugin/org/osmf/mast/media/MASTProxyElement.as

  • Batch command to find java version

    Hi
    I need to get the version of java runtime env on a machine using command prompt (more specifically in a batch file). java -version at command prompt gives me the version and other stuff. But has anyone written a batch file that extracts values like 1.3.1 or 1.4.0 by executing a batch command??
    Any suggestions woul dbe helpful
    Thanks
    VP

    Here's my thoughtsjava -version 2>tmp.txt         //pipe version to file
    find "java version" tmp.txt|find "java version">tmp2.txt  //just get info
    del tmp.txt
    for /f %i in (tmp2.txt) do @set version=%i  // set a variable
    del tmp2.txt
    set version=%version:~10,5%                 // you get offsets
    @echo %version%You will need to debug this.
    P.S. IS this Java Programming?

  • How to find Software version using a copy of software without installing

    How to find Software version using a copy of software without installing

    How to find Software version using a copy of software without installing
    See answer given by Ahmed
    Right click on setup file and select properties and then details tab.
    http://social.msdn.microsoft.com/forums/sqlserver/en-US/c5424ffa-ce98-4899-ac0d-97cbcac10029/how-to-get-versionbuild-from-sql-install-media
    You can also open Mediainfo.xml to see information from Installation file
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • How to retrieve constants value from compiled code in jar file?

    Hi everyone,
    I've been looking for a way to solve this for a week now, without any much success... and I've finally decided to ask the Java gurus for a solution! :-)
    Here's what I am basically trying to do:
    I have several jar files in which there are only compiled code (.class).
    In every class, there are 2 constants (declared as static final String) that I would like to retrieve (one is the version and the other the date of the last modification).
    My goal is to print a list of all the classes in the jar files with the values of these 2 constants for each class.
    The solution that I have right now to do this does not work properly: for now, I read all the elements of the classpath, check if these are jar files, and if so, I look into each one and load all the classes one by one and print the results.
    The problem with this is that it uses the method Class.forName(className) and as some classes are unfortunately present in many jar files (2 or 3 copies), once the classes have been loaded, then it won't be "reloaded".
    Without the possibility to "reload" these classes, I cannot see inconsistencies in the versions of the classes present in the jar files.
    I have read many articles, and I thought that I could then use a custom classloader and create a new instance of this classloader for each jar file.
    2 problems with this:
    - according to many posts in the different forums I have read, the jar files should not appear in the CLASSPATH (but this would be easier for me if I could use it...)
    - some classes will not be loaded if some classes (present in other jar files) are not loaded... and this makes things really really complicated to implement...
    So, I thought that I was maybe doing this the wrong way, and that there might be an easy way out of this...
    In fact, I do not need to load the classes... all I need to do, is take a sneak peek at the constants and print their values... and that's it!
    Somehow, I think that this is possible to retrieve the values of compile time constants (declared as static final String) as I can see that with Eclipse (when opening a jar file).
    So, my question is: how can I do that within my java application?
    Or maybe there is another easier solution to do what I need?
    Thanks in advance for your help!

    Hi everyone,
    I've been looking for a way to solve this for a week now, without any much success... and I've finally decided to ask the Java gurus for a solution! :-)
    Here's what I am basically trying to do:
    I have several jar files in which there are only compiled code (.class).
    In every class, there are 2 constants (declared as static final String) that I would like to retrieve (one is the version and the other the date of the last modification).
    My goal is to print a list of all the classes in the jar files with the values of these 2 constants for each class.
    The solution that I have right now to do this does not work properly: for now, I read all the elements of the classpath, check if these are jar files, and if so, I look into each one and load all the classes one by one and print the results.
    The problem with this is that it uses the method Class.forName(className) and as some classes are unfortunately present in many jar files (2 or 3 copies), once the classes have been loaded, then it won't be "reloaded".
    Without the possibility to "reload" these classes, I cannot see inconsistencies in the versions of the classes present in the jar files.
    I have read many articles, and I thought that I could then use a custom classloader and create a new instance of this classloader for each jar file.
    2 problems with this:
    - according to many posts in the different forums I have read, the jar files should not appear in the CLASSPATH (but this would be easier for me if I could use it...)
    - some classes will not be loaded if some classes (present in other jar files) are not loaded... and this makes things really really complicated to implement...
    So, I thought that I was maybe doing this the wrong way, and that there might be an easy way out of this...
    In fact, I do not need to load the classes... all I need to do, is take a sneak peek at the constants and print their values... and that's it!
    Somehow, I think that this is possible to retrieve the values of compile time constants (declared as static final String) as I can see that with Eclipse (when opening a jar file).
    So, my question is: how can I do that within my java application?
    Or maybe there is another easier solution to do what I need?
    Thanks in advance for your help!

  • Cannot Change Java Version Using Java Preferences

    When I attempt a change of the current Java version (say, switching from 1.5 to 6) using Java Preferences, the change is reflected in the preferences, but the update does actually occur and java -version continues to report Java 1.5 as the current version.
    If I create another account, this work just fine and I can switch versions at will. Anyone have any idea what might be missing from my account?

    Ok, I figured out what was going on: I had explicitly set my JAVA_HOME in ~/.bash_profile, pointing to the symlinked path for the current JSE. It turns out there a new CLI tool /usr/libexec/java_home that can be used to assign JAVA_HOME like this:
    export JAVAHOME=`/usr/libexec/javahome`
    Using this will ensure that JAVA_HOME is set to the correct value when the shell starts up (if you don't have JAVA_HOME set at all, you can switch the JSE versions in the Terminal 'on-the-fly' when changing the Java Preferences setting).
    http://lists.apple.com/archives/java-dev/2009/Jun/msg00139.html
    Message was edited by: stonehippo

  • Detecting Java Version using Javascript??

    Hi,
    This is a Javascript & Java question really. The problem i have is i want to detect what version of Java a user has.
    So using Javascript i can find if java is enabled like so:
    navigator.javaEnabled();
    but i want to know what version as well.
    I tried:
    var version = java.lang.System.getProperty("java.version");
    but had not luck. does anyone know if this is possible and if so how?
    thanks,
    Chris.

    Because Sun chooses to use a weird format for their version numbers, and since Internet Explorer uses ActiveX objects instead of normal plug-ins, you'd have to write a script that could skim through the Windows registry to dig up what the latest version of the Java Plug-in is.
    Scanning through the registry isn't a problem, so much as the non-conventional versioning system that Sun has in place. With Netscape, Opera, and other non-ActiveX browsers, it's a piece of cake.

  • Where to find java version 1.4.2-b28

    Hi,
    I need to download the JSDK (exactly) for the java version 1.4.2-b28. Can someone send me the link?

    Hi,
    I need to download the JSDK (exactly) for the java
    ava version 1.4.2-b28. Can someone send me the link?
    Try this link:
    http://java.sun.com/products/archive/index.html

  • How to tell what java version classes where compiled?

    Is it possible to get the version of the Java SDK the classes were compiled with from within a Java application? I think about something like:
    System.out.println("Application classes compiled/compatible with "+getClassCompilationVersion());

    For the minimum check, the point is that i get the following exception when i try to run a application that was compiled with/for 1.4 is tried to be started with a 1.3 JRE:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: de/icomps/pro
    totypes/Test (Unsupported major.minor version 48.0)
            at java.lang.ClassLoader.defineClass0(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
    6)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)I hoped to somehow catch this and print a clean error message. But it seems, that the new classes can't be used ... even though the main() method doesn't use any 1.4 specific API. The JVM rejects the classes just because of the newer class file format versions.

  • Creating Plugin Modules for Use with Compiled Code

    Hi all,
    While programing a data analysis package in Labview, I've run into a problem that I don't really know how to answer.  It goes something like this: my program receives data from measurement devices in the form of ASCII or binary files, which I must then process and evaluate.  The problem is, the data files can have a variety of different formats.  Right now, I only know of 4 or 5, but more could literally be added at any time.
    My thought is this: I'd love to have some sort of modular plugins for reading the data files.  In other words, I could have a subfolder under my application's space in the "Program Files" directory.  The subfolder would contain any number of "ReadFileX.xxx" modules.  Upon initiation, my code would scan that folder, determine the possible formats (based on the *.xxx files therein), and be capable of reading any of the files.  Ideally, the user would select a file, I would note its format, and call the appropriate plugin module to handle reading the data into my code.
    What is the best approach for doing something like this?  I looked (briefly) into using DLL's, but (from what I can tell) I would need to explicitly define the function name and the inputs / outputs in the "Call Library Node" function.  This would appear the break the modularity feature, as I want to be able to load the software, and then develop new plugins down the road when the need arises.  I also found some information on source distributions (in an LLB).  This option would probably work, but my efforts at coding a basic test of VI-Server were met with errors.
    Does anyone have any experience performing a similar task?  If so, would you share your knowledge / secrets with me?  I would be extremely grateful for your feedback.
    Thanks!
    Mark

    Mark - there is a Coding Challenge currently going on, and I have submitted an entry that shows how to dynamically instantiate a class based on a class that resides on disk. Specifically, you're going to be interested in "Get LV Class Default Value.vi" under the "Cluster, Class, and Variant" palette that allows you to create an instance of an object based on the path of the .lvclass file. The class you load is going to be what's called a child class of a parent class (or base class), where the child class implementation overrides the function of the parent class. The "Get LV Class Default Value.vi" is very loosely analogous a Class Constructor.
    You can deploy your application having implemented all the base class functions, then subsequently develop and deploy new classes to reside in a "plugins" folder without needing to change the original app code.
    If you find that contest entry helpful, consider dropping a vote, huh? The LabVIEW Communities have had access errors sporadically the past few weeks, so if you get a "Server Error" you may need to try again later. There's also going to be Forums maintenance today and tomorrow.
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • Find sap user id from release code and release group

    does anyone know any FM that can get sap user id from certain release code and release group?
    ex: if i input rel code 40, rel group N1 , then it should be sap user id A
    i would prefer FM rather than tables and tcode.

    Hello,
    Please find attached list of tables
    T16FB                          Release Indicator: Purchasing Document
    T16FC                          Release Codes
    T16FD                          Description of Release Codes
    T16FE                          Descriptions of Release Indicators: Purcha
    T16FG                          Release Groups
    T16FH                          Descriptions of Release Groups
    T16FK                          Release Statuses
    T16FL                          Release Indicators: Service Entry Sheet
    T16FM                          Descriptions of Release Indicators for Ser
    T16FS                          Release Strategies
    T16FT                          Descriptions of Release Strategies
    T16FV                          Release Prerequisites
    T16FW                          Assignment of Role to Release Code
    Thanks & Regards,
    Mihir Popat

  • Invoking java exe from C++ code

    Most of my applications are in c++, i have one application in java.
    How can I invoke the java application(jar) from c++ code?

    Hi We can do this by using EXTERN C functionality provided by c++ ,
    by using this we can call the Java functions from Java .class file.
    or .jar file.
    (for java developers ......its similer to JNI)
    if you want more details aboth such code just search it on web , you will get number of programs here.
    Thanks,
    -Akshay

  • Create java procedure using jdbc

    Hi,
    I am trying to create java procedure using jdbc connection, I am using Oracle 11.2. When I create the procedure using sqlplus it works fine. Using jdbcit fails; code sniplet below:
                   ddl =
                   "create or replace java source named \"UTLCMD\" as \r\n"+
                   "import java.lang.Runtime; \r\n"+
                   "public class execHostCommand \r\n"+
                   "{ \r\n"+
                   "public static void execute (String command) \r\n"+
                   " throws java.io.IOException \r\n"+
                   " { \r\n"+
                   " Runtime rt = java.lang.Runtime.getRuntime(); \r\n"+
                   " rt.exec(command); \r\n"+
                   " } \r\n"+
                   statement = conn.createStatement();
                   statement.executeUpdate(ddl);
    I am getting this error:
    2013-01-26 12:45:31.835 UTC: ERROR: Exception "java.sql.SQLException: ORA-29536: badly formed source: Encountered "ublic" at line 3, column 1.
    Was expecting one of:
    "extends" ...
    "implements" ...
    "<" ...
    ". Stack dump:

    Hi,
    We can load java class using blob column, for example :
    create or replace and compile java class using blob select code from java_code;If class is OK, but resolution of referenced names to other classes failed, statement.execute() will not show any error and we need to 'select from user_errors' view for errors. How can we got the required object name for loaded class?

  • How to find the version of oem

    How to find the version of the installed oem?
    I have /home/oracle/10.1.0/oem
    But I wanted to know the the last digit as well
    thanks

    BTW - For both DB Control and Grid Control, you can also use also find the version using the url (assuming your EM is already working)
    http://servername:port/em/console/aboutApplication
    From the displayed page, you can also click on the License url to go to the Oracle Enterprise Manager 10g License Information.

  • Mainframe problem - java -version output : Error: unable to allocate

    Hi,
    I am calling "java -version" command from my java program. my program is executing well but when it comes to execute this command using Java Runtime it giving following error.
    java -version output : Error: unable to allocate 67108864 bytes for GC in j9vmem_reserve_memory.
    Error: unable to allocate 53686784 bytes for GC in j9vmem_reserve_memory.
    Error: unable to allocate 42949120 bytes for GC in j9vmem_reserve_memory.
    Error: unable to allocate 34359296 bytes for GC in j9vmem_reserve_memory.
    Error: unable to allocate 27487232 bytes for GC in j9vmem_reserve_memory.
    JVMJ9VM015W Initialization error for library j9jit23(11): cannot initialize JIT
    Could not create the Java virtual machine.
    and pogram continue executing.
    is any body have idea why it is behaving like this and wht needs to be done.
    this program i am writing for IBM mainframe machine.

    java -version output : Error: unable to allocate 67108864 bytes for GC in j9vmem_reserve_memory.
    Error: unable to allocate 53686784 bytes for GC in j9vmem_reserve_memory.
    Error: unable to allocate 42949120 bytes for GC in j9vmem_reserve_memory.
    Error: unable to allocate 34359296 bytes for GC in j9vmem_reserve_memory.
    Error: unable to allocate 27487232 bytes for GC in j9vmem_reserve_memory.
    JVMJ9VM015W Initialization error for library j9jit23(11): cannot initialize JIT
    Could not create the Java virtual machine.As a guess
    1. Environment is messed up
    2. Install of java is messed up.
    You might look for command line options that allow you to change the heap size. Try making it smaller.
    You might also want to verify that the 'java' you are running is actually the binary that you think it is, versus a script/link to someplace weird.

Maybe you are looking for

  • CUIC 9.0 Custom Reporting/Dashboards

    Good Afternoon, I am relatively new to CUIC as a whole so any feedback to the following question is appreciated. I am a manager at a contact center who recently made the jump from Avaya to Cisco this month. I am looking for a way to create a customiz

  • How to get replied date & time of an email

    I am using MS outlook 2010 from this month (August 2014), So i work on so many emails from different persons and I want to see time taken to on each email from the time I recieved it till the time I replied. Once I get a column with replied time deta

  • Is there a hotkey to break the handles of points while you're using the pen tool?

    When you use the pen tool, it smooths the points as you add them, but sometimes I don't want that, So far, the only way I've been able to combat this is by using the pen tool, pressing V to switch to the selection tool, clicking elsewhere to deselect

  • Video & Podcast has sound but NO video

    When I sync video or podcast to my 30g Ipod, It just shows a small still picture with the title beside it. It does play sound but absolutly no video. How do I fix this problem?

  • Accidentally clicked delete after iPhoto import

    Greetings, I just accidentally clicked delete all after importing from my wifes iPhone 4s to her iPhoto library. I very quickly grabbed the USB cable out of my mac mini and the photo's are fine in the library and phone. But I'm curious about what wil