To get JRE or JDK version in Programs

How do get JRE or JDK version in Application Programming?. Kindly Reply...
By
Mani

Hi Manivel.
The System class has methods such as getProperties() and getProperty() that can be used to get almost any system info. To get the version of JRE, for example, you could use something like this:
System.getProperty("java.version");
Check the J2SE 1.5 API reference for more info. Use this URL to go directly to the API reference for the java.lang.System class:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html
Hope this answers your question.
By the way, this is the JDBC forum. In the future, please post such questions in the Java Essentials forum (http://forum.java.sun.com/category.jspa?categoryID=5) or the Core APIs forum (http://forum.java.sun.com/category.jspa?categoryID=32).
Shakeel.
:)

Similar Messages

  • To get JRE or JDK version using Java Programs

    How do get JRE or JDK version using Java Programs?.
    Kindly Reply...
    By
    Mani

    If you're talking about current program's runtime environment (as opposed to all installed JDK/JRE) : System properties

  • JRE vs JDK

    Hi
    I am doing this to find the version of JDK :
    apcltest@TEST:cd /usr/java14/bin then ./java -version
    java version "1.4.2"
    I do this to find the version of JRE:
    ordbtest@TEST:/oradbi2/oracle/testdb/9.2.0/jdk/bin
    ordbtest@TEST: java -fullversion
    full version: J2RE 1.4.2
    Both JRE and JDK versions are the same.
    I read on spots like this
    http://www.novell.com/communities/node/5812/ways-access-oracle-application-linux-environment
    that we should
    "Verify and confirm the version of JRE/JDK of Oracle Application server" This implies that the version of JRE is going to be the same as the version of JDK.
    Is JRE supposed to be the same? Are both found on the Apps server?
    (I can only find JRE on the db end, since the jdk does not exist on $ORACLE_HOME in apps.

    Thanks I will check those right now.
    I was just reading this on Note 418399.1
    A "database" Oracle home contains both a JDK ($ORACLE_HOME/jdk) and a JRE ($ORACLE_HOME/jre/1.4.2).
    In order to find out the current Java versions you can run:
    cd $ORACLE_HOME/jdk/binjava -versioncd $ORACLE_HOME/jre/1.4.2/binjava -version
    For both Oracle 10.1 and Oracle 10.2 database homes, the result for both the JDK and the JRE are usually 1.4.2_x, where x is the "update" number. The update version can be different between the JDK and the JRE.
    So its usually the same version ... but I am still not sure if we should look for JRE / JDK on tha apps, or the db.
    Let me check those notes you posted
    Thanks.

  • Java JDK versions and compilation levels

    Hi,
    I have a question about differents java versions and the compilance level. As far as I know, if I am developing an application, for example a swing application or a JSF web project, that will be deployed to run in a JVM 1.6, I must compile my code with similar JDK, in this case, I must compile my code with a 1.6 JDK.
    But, for example, can I use JDK 1.7 with compilance level 1.6 to run code under 1.6 virtual machine?
    Suppose a JSF web project compiled with JDK 1.7 and source level 1.6 can be deployed on a tomcat that run in a 1.6 VM?
    If that is correct, I think that I should always get the last JDK version installed in my computer and choose the different compilance level (example 1.4, 1.5, 1.6 or 1.7) to compile my code based on the target JVM, is that correct?
    Thanks for your help, regards.

    kerule wrote:
    If my project will be executed on a JVM 1.4, I must have installed in my computer a JDK 1.4 and the project must be compiled with 1.4 JDK
    If my project will be executed on a JVM 1.6, I must have installed in my computer a JDK 1.6 and the project must be compiled with 1.6 JDK
    If my project will be executed on a JVM 1.7, I must have installed in my computer a JDK 1.7 and the project must be compiled with 1.7 JDK
    Correct?Yes, and NO: the problem with what you said is "must be". If you compile with 1.7, but use objects that are backwardly compatible with 1.4, then it will work in 1.4 onward, but if you use features of 1.7 that are not compatible or possibly not available in 1.4, then you will not run in 1.4.
    Your statements:
    If my project will be executed on a JVM 1.4, I must have installed in my computer a JDK 1.4 and the project must be compiled with 1.4 JDK
    If my project will be executed on a JVM 1.6, I must have installed in my computer a JDK 1.6 and the project must be compiled with 1.6 JDK
    If my project will be executed on a JVM 1.7, I must have installed in my computer a JDK 1.7 and the project must be compiled with 1.7 JDKare safe, except where/if inconsistancies exist between versions.

  • How to compile a java file with specified jdk version in a program???

    hi,
    if we want to compile a program in another program with a particular
    jdk version as an option, how to do that,plz reply and with example.

    Hi,
    To compile from a program, read this (I've never tried, but I think it
    will work):
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Compiler.html
    To get the jre version:
    System.getProperty("java.version");
    To get the vm version:
    System.getProperty("java.vm.version");
    Other properties at:
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/System.html
    Hope it helps,
    ANeto

  • Why can't I run my Java program with just the JRE, the JDK is required?

    I've recently written 3 programs in Java using the Netbeans IDE with JDK 1.6 as the default Java platform. The compile-time libraries include the Swing Application Framework. I use BuildDesk from ProductiveMe to package the each program into a Windows installer.
    When I install the programs on a new computer without a JRE or JDK being present, and attempt to run them I get an error (as expected) stating that there is no JVM. The messages says that I need to install JDK 1.3 or higher. I downloaded the latest JRE onto the new computer and attempted to run the programs and I get the same error message. My question is, why can't I run these programs with just the JRE installed? Why do I need the JDK? When I install the JDK, the programs run fine. The typical user may not have the JDK on their system, but they likely have the JRE if they've run Java programs before.
    Is the answer as simple as there must be library functions being used by the programs that belong to the JDK, but not the JRE? I'd rather a user not have to install the JDK verses the JRE because they may also have to update some Windows environment variables.
    Thank you for any help on this issue.

    915088 wrote:
    Thanks for your replies. I further investigated BuildDesk and found an option which allows a JVM check but that check needs the JDK. I stopped the JVM check and rebuilt using BuildDesk and it now only requires the JRE to run the programs. The reason why I use BuildDesk is to package more than just the jar file for the user. BuildDesk allows me to create a installation folder structure as well as include any other files in the build. I could just as well zipped all this together for the user but decided against that method.I don't think anyone will question your usage of an installer tool; that is entirely up to you. But what is questionable is that you have problems with that installer tool and then go look for help in a Java programming forum. The next time, go look for help at the source. If there is no way to acquire help (support, a forum, a mailinglist, anything) then that is a very good reason to not use the product in question.

  • HI,  I need to jre 1.6 update 26 on my mac system to make some aaplication work. However latest available is jre 1.6 update 29. Could you suggest how I can get jre 1.6 update 26? I tried downloading older version on java. COuldn't find it on your site.

    HI,  I need to jre 1.6 update 26 on my mac system to make some aaplication work. However latest available is jre 1.6 update 29. Could you suggest how I can get jre 1.6 update 26? I tried downloading older version on java. COuldn't find it on your site.

    What are you missing?
    I inherited this app and signing the third party jars is how it was setup, I was wondering the same thing too, why was it necessary to sign the third party jars?
    The applet runs in either JRE 1.6.0_13 or JRE 1.6.0_27 depending on the other Java apps the user uses. JRE 1.6.0_13 does not have the mixed code security (so it is like is disable), but JRE 1.6.0_27 does have the mixed code security and the applet will not launch with mixed code security enable, so we have to disable it. With all the hacking going on in the last two years, is important to improve security; so this is a must.
    Yes, I always clear up the cache.
    Any idea on how to resolve this problem?

  • To Get Different Version of program through programatically.

    Hi Experts,
    My requirement is to find no. of line changes betwwen two version of program.
    I did the following steps
    i) Got  the Transport request number from table e070 for corresponding users.
    ii) Got the pgmid object obj_name from table E071.
    iii) Got the remaining details from TADIR and trdir table.
    And for Each name file from TADIR table,
    By using Read Report statement I got the program in Internal table and able to count the no of lines,
    But how i can retrieve the different/old version of program.
    Your early reply would be highly appreciated.
    Thanks
    James

    Hi Vikranth,
    I know VRSD is the table we can get the version number, but for both version the
    Program/object number will be the same. So we cannot achive my requirement.
    Hi Markus,
    I am looking into the compare_versions form, but its clueless for me!,
    How it works any idea?
    Regards
    James

  • Unable to find an installed JRE or JDK of version 1.4 or higher

    hello friends,
    i have facing an error when i tired to install JEdit setup and i hav faced this error before also but what is this error...
    *"unable to find an installed JRE or JDK of version 1.4 or higher"*
    I have installed jdk5 and i have set Environmet variables as below
    JAVA_HOME: E:\JAVA_ALL\JDK\jdk5.0
    and in path---->
    PATH: %JAVA_HOME%\bin;%JAVA_HOME%\lib\tools.jar;
    * do i need to give any thing more than this...?
    thax in Adv.
    Ajay

    http://community.jedit.org/

  • Installing i-tunes i get the message "older version of bonjour cannot be removed". What to do? I have uninstalled all old itunes/apple programs

    My itunes crashed and I uninstalled all apple/itunes products (I thought) and tried a fresh install. When I install I get the message "older version of bonjour cannot be removed" or "bonjour.msi" not available. How do I reinstall itunes from here?

    When I install I get the message "older version of bonjour cannot be removed" or "bonjour.msi" not available.
    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. (The results from mydigitallife and Major Geeks are worth checking.)
    After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any Bonjour entries and click "Remove".
    Quit out of CleanUp. Restart the PC, and try another iTunes install. Does it go through properly this time?

  • Get jdk version throgh applet

    hi
    how can i determine which jdk version the browser is using from applet.i want to tell the user that if he is using jdk1.4 version than a message appears that this applet can be run on jdk1.3 or less.
    Thanks

    Like I said,I am not a big applet maker but I would
    think this would cause a security exceptionI can't tell if this was a reply to my 2nd response, it seemed a little too quick. Anyway, if you didn't catch that, check here:
    http://java.sun.com/docs/books/tutorial/applet/practical/properties.html
    You can check the version with applets.

  • JAVA_HOME, JRE and JDK

    Does anyone know what JAVA_HOME should be pointing to if only the JRE in installed? What it should be pointing to if the JDK is installed?
    On Windows, I notice that c:\program files\JavaSoft gets created after install. For which install does that happen? For the JRE and JDK install? Should JAVA_HOME be pointing to that directory?
    I couldn't find any java.sun documentation about the role of the JAVA_HOME env var. If anyone can piont me to some, that would be appreciated. :-)
    Version: 1.3.1
    Thanks in advance.

    Dear dinogg
    Does anyone know what JAVA_HOME should be pointing to
    if only the JRE in installed? What it should be
    pointing to if the JDK is installed?
    set JAVA_HOME=C:\jdk1.3.1\bin
    On Windows, I notice that c:\program files\JavaSoft
    gets created after install. For which install does
    that happen? For the JRE and JDK install? Should
    JAVA_HOME be pointing to that directory?
    actually it is for jre but when u install jdk it also install jre if you notice there is a part setting up java runtime environment
    I couldn't find any java.sun documentation about the
    role of the JAVA_HOME env var. If anyone can piont me
    to some, that would be appreciated. :-)
    not sure where you can find it
    Version: 1.3.1
    Thanks in advance.
    version 1.4.0 is out and it is nice
    new stuff like scroll mouse, undecorated dialogs, xml transformer better focus management and etc
    Thanks
    Joey

  • JDK version for installing SOA suite on windows vista

    Hi
    I am trying to install SOA Suite 10.1.3.1 on my Windows Vista 64 bit system. Currently, when running irca.bat, I am getting error "invalid java version 1.6.0_13. Version 1.4 is required."
    But isnt the script supposed to run for all 1.4+ jdks. Which version of jdk do I need to install?
    Thanks.
    John

    The complete error message in the popup is "Error in CreateOUIProcess(): 3". When you hit <OK>, you are back at the command prompt where you typed setup.exe.
    The log is as follow:
    Using paramFile: D:\Disk1\install\win64\oraparam.ini
    Checking if CPU speed is above 300 MHz. Actual 2327 MHz Passed
    Checking swap space: must be greater than 500 MB. Actual 12689 MB Passed
    Checking monitor: must be configured to display at least 256 colors. Actual 65536 Passed
    The commandline for unzip:
    D:\Disk1\install\win64\unzip -qqqo ..\..\stage\Components\oracle.swd.oui\11.1.0.7.0\1\DataFiles/"*.jar" -d "C:\Users\ROOT~1.APP\AppData\Local\Temp\3\OraInstall2009-10-20_06-01-08PM"
    The commandline for unzip:
    D:\Disk1\install\win64\unzip -qqqo ..\..\stage\Components\oracle.swd.oui.core\11.1.0.7.0\1\DataFiles/"*.jar" -d "C:\Users\ROOT~1.APP\AppData\Local\Temp\3\OraInstall2009-10-20_06-01-08PM"
    The number of files bootstrapped for the jre is 0.
    The number of files bootstrapped for the oui is 287.

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

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

Maybe you are looking for

  • Mini as a Media Server

    http://www.imageno.com/zkikentocfg7pic.html I want to hook up a Mini as a Media Server to the above A/V receiver. What do I need, and where do I make the connections ?

  • Google's "Talkgadget" opening multiple tabs in safari

    While using Google Chrome (my secondary browser) the other day I must have accidently touched/swiped something using my TouchPad on my Google Plus site and since then I cannot stop multiple tabs from repeatedly opening in Safari, which is my default

  • Download mp3

    Dear all I am newbie in iphone4s. yesterday my sons music teacher sent me a mp3 file ( a song for my sons concert ) . after i downloaded , it was automatically played with quicktime . but i didnt find any sign which i can save that file. so im search

  • Why on earth the 8443?

    What best can you do over the last bit of Friday? Yeah, you discovered that the SQL Azure team decided to use 8443 as the port number, and ALSO, your office firewall is blocking the outbound for that port, (yes, IT policy does exist, there is no way

  • 0x80070005 when trying to push Registry Settings via GPP on 2008R2 Servers

    Hello, I'm trying to push registry settings via Group Policy Preferences to a group of Windows Server 2008 R2 to set dynamic RPC ports range, but I keep getting an error 0x80070005 Access is denied The Registry Settings I need to push are these Ports