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

Similar Messages

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

  • Get FolderNames,FileNames,FileSize,FileProperties using Java programes?

    Hi All,
    How to get windows folder names,file names,file size and this related properties (Like when that file crated,modified....)using Java programes?
    Plz., help me guys...
    -Mohankumar

    depend on date and time we can get.
    For Example:
    Let One folder inside many files are there. These files are stored corresponding with date and time.So we can identifying the old or new depend on date and time(which one is old?.,which one is latest?).
    In java, How to implement this logic?

  • Get the form module version using JDAPI program

    Hi
    I have one problem to find the verison of form module using java (JDAPI) programming.
    To the JDAPI program i am just passing the form name. by reading the form it has to say the form version.
    Is there any method to get this...
    Thanks in advance.
    Madhava

    I solved my problem...
    first of all.
    Versioning was enabled for the folder but apparently it didnt work so i disabled it and enabled it again. Then I got the correct reource instead of null.
    second thing
    later in mycode I used this to get the path of the resource
    resource.getRID().getPath();
    but this gives the path to where the version of the document can be found... something like /documents/~System/xx/xxxxx/xxxx
    where x is numbers
    after doing a little debugging I found out that
    resource.getAccessRID().getPath()
    returns the path to where in CM the resource is stored.
    I hope My experience here can help others.
    I am glad that I solved my problem, but I find it extremely worrying that some settings in CM apparently stops working without any apparent reason.
    We have experienced this with other properties like Manual Ordering, Approval process, have any one else had these problems and found the cause then I would like to hear about it

  • How can we get requester's user id using java code

    Hi,
    How can we get requester's user id using java code?
    eg: If i had logged in as xelsysadm and request a resource for user uid101 on the userid field it should display uid101 and not xelsysadm.
    also,
    I have a resoure "A" which on revoking should also revoke resources B and C. How can it be done. Resource A, B, and C are 3 different resource objects.
    ==Thanks,
    doki

    Ok, so there is a way, but it's not available during submission. You can use the findRequests api. From the result set, get the "Requests.Consolidated Data Value" value. In this information, you will get an xml formatted data. It provides the list of users on the request on the left side after submission. After the request is completed, this value is available. Upon completion, you could get the request information, get this value, and parse the information for user ids.
    In the same adapter, use the following API:
    formIntf.setObjectFormData(objInstanceKey, formHash)
    The formHash is a hashtable containing the field name on your object form, and the values you wish to populate it with. You could create a textarea box on your object form and populate the userids for who the request is for.
    However, this makes absolutely 0 sense. When you get a request, the list of userids are listed right there on the request.
    -Kevin

  • How to get free disk space in linux   Using JAVA program ?

    Hi,
    I am new to such adavance topics.. like JNI
    I have to check linux system free disk space , if space is more than 80% it should email to user.
    But how to check that Using Java program ??
    can u give me one sample example ? i will do it if u can do some for me
    thanks
    give me possible solutions...

    Using the Runtime class you can execute any linux command. Check it out.

  • How to read system evenlog using java program in windows

    How to read system evenlog using java program in windows???
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Welcome to the Sun forums.
    >
    How to read system evenlog using java program in windows???>
    JNI. (No.)
    >
    is there any java class available to do this ? or any one having sample code for this?>You will generally get better help around here if you read the documentation, try some sample code and come back with a specific question (hopefully with an SSCCE included).
    >
    Your friend Zoe>(raised eyebrow) Thank you for sharing that with us.
    Note also that one '?' denotes a question, while 2 or more generally denotes a dweeb.

  • JDBCDataSourceRuntime Information for Weblogic 10.3 using Java program

    Hello All,
    I am trying to get the JDBC datasource connection pool status in Weblogic 10.3 using java program - if it is in RUNNING state or Shutdown state.
    Can someone provide me with the same java program for achieving this.
    - - Tarun

    Refer to this Doc ......... It may help you.
    http://download.oracle.com/docs/cd/E12839_01/web.1111/e13728.pdf

  • How to open specific port using java program

    Hello,
    I want to open ,close port using java comm.plz help me how can i do it.is it possible
    by using java program.later i want to use that specific port to accept the server socket connection .plz
    help me.

    i try this java program.*but it get block in accept method*.tht mean i m not able to make connection with port.
    import java.sql.SQLException;
    import java.io.IOException;
    import java.net.ServerSocket;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    class MakeConn
         public final static int PORT = 7788;
    public static java.net.Socket clientSocket = null;
    public static java.io.PrintWriter pw = null; // socket output stream
    public static java.io.BufferedReader br = null;
    public static ServerSocket server_socket;
         public static void main(String[] args) throws SQLException
         try {
              server_socket = new ServerSocket(PORT);
    clientSocket = server_socket.accept();
    System.out.println("CLIENT>>>" + clientSocket);
         br = new java.io.BufferedReader(new java.io.InputStreamReader(clientSocket.getInputStream()));
    pw = new java.io.PrintWriter(clientSocket.getOutputStream(), true);
    String message = br.readLine().trim();
    System.out.println("message is"+message);
    pw.close(); // close everything
    br.close();
    clientSocket.close();
         catch (Exception ex) {
    ex.printStackTrace();
    }

  • Setting persitent system environment variables using java program

    hai,
    Iam tryng to write installation for an application,which require to set some persistent system environment variables using java program. I have tried using set command Runtime.getRuntime().exec("cmd /c set blah blah "),but this applies only to that particular DOS promt only,i presume.And this is not perisistent.please do help.
    Biju

    The solution I proposed worked only on Windows XP/2003.
    The following solution will work on Windows NT/2000/XP/2003 with JDK 1.2+.
    1- Download the [url http://www.gjt.org/download/time/java/jnireg/registry-3.1.3.zip]JNIRegistry zipped archive.
    2- Open the registry-3.1.3.zip file and extract in the folder of your choice ( Eg. c:\setenv ) only the 2 first files (when sorted by path): ICE_JNIRegistry.dll and registry.jar.
    You don't need to keep the folder tree in the extraction.
    3- Create the following SetEnv.java file in the same folder ( Eg. c:\setenv ).
    import com.ice.jni.registry.Registry;
    import com.ice.jni.registry.RegistryKey;
    import com.ice.jni.registry.RegStringValue;
    import com.ice.jni.registry.RegistryValue;
    public class SetEnv
        static final String REG_HKLM_SUBKEY_NAME = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
        public static void main(String[] args)
        throws Exception
            new SetEnv().exec(args);
        void exec(String[] args)
        throws Exception
            if (args.length != 2)
                throw new IllegalArgumentException("\n\nUsage: java SetEnv {varName} {varValue}\n\n");
            String varName = args[0];
            String varValue = args[1];
            RegistryKey key = null;
            RegStringValue value;
            try
                key = Registry.HKEY_LOCAL_MACHINE.openSubKey(REG_HKLM_SUBKEY_NAME, RegistryKey.ACCESS_ALL);
                value = new RegStringValue(key, varName, RegistryValue.REG_EXPAND_SZ);           
                value.setData(varValue);
                key.setValue(value);
                key.flushKey();
            finally
                try { key.closeKey(); }
                catch (Exception e) {}
    }4- Compile it.
    javac -classpath .;registry.jar SetEnv.java
    5- Run it. varName and varValue are strings of your choice.
    java -classpath .;registry.jar -Djava.library.path=. SetEnv varName varValue

  • How to create a directory or Folder  using java program?

    Hi all,
    Can any one know, how to create a directory(new folder) in java.
    can any give me some idea, on creating a directory using java program dynamically.
    thanx in advance

    hi thanks for your answer,
    sorry, actual i know this technique(its my fault i didnt mentioned it)
    i am looking for some what different technique.
    bye
    ram

  • Interaction with Microsoft Word using Java Programming

    writing Text ON TO MICROSOFT WORD USING java Programming Urgently required

    Go throuh jakarta POI(hssf) to do..No! HSSF which stands for Horrible SpreadSheet Format can be used for Excel (spreadsheets as the name suggests). For Word, you would need to lok at HPSF.

  • How to find cd rom drive in windows and unix platform using java program

    Hi,
    I am having the requirement of finding the cd rom drive
    using java program. I do not know the label and which
    one is the cd rom drive. also I want to know how many
    cd rom drives are there on my system. I want the solution
    for windows and unix platforms.
    If have any suggestions please mail to [email protected]
    Deepak

    Ughhh.. I had the same problem with multi platform file-system detection
    First off - Unix.
    Do you know for sure you have all your drives mounted?? This could be a big problem because java will not see unmounted drives... So you can scour thru your /etc/fstab to find out which drives are available... or you can mount all and show roots... (Yuck!)... You've got timeouts and all sorts of things to worry about...
    I would then shy away from the java.io.File.listRoots() on unix and rely on parsing your fs file. If a user would like to see the medium in the drive. Do a Runtime.exec and mount the drive, then you can grab the filesystem by wrapping it in the java.io.File object. ( NOTE - this will hold well for your NFS mounts as well which might be buried under other FS. So you now have detection for that as well. ) Labels are also noted in this file. Let me know if you don't know the difference between mtab and fstab....
    Second - Winders.... Corney but I love saying that.
    The listRoots is a good solution. As others have said CD-ROMS will not be writable. Use a combination of getName and getPath to decipher the label and mount point.
    Hope this helps!

  • How to read system eventlog using java program in windows?

    How to read system eventlog using java program in windows?
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Hi,
    There is no java class for reading event log in windows, so we can do one thing we can use windows system 32 VBS script to read the system log .
    The output of this command can be read using java program....
    we can use java exec for executing this system32 vbs script.
    use the below program and pass the command "eventquery"
    plz refer cscript,wscript
    import java.io.*;
    public class CmdExec {
    public static void main(String argv[]) {
    try {
    String line;
    Process p = Runtime.getRuntime().exec("Command");
    BufferedReader input =
    new BufferedReader
    (new InputStreamReader(p.getInputStream()));
    while ((line = input.readLine()) != null) {
    System.out.println(line);
    input.close();
    catch (Exception err) {
    err.printStackTrace();
    This sample program will list all the system log information....
    Zoe

  • Set system classpath using java program??

    Hi,
    I want to set the System classpath using java program. Can somebody please tell how to do this.
    Prashant

    but this will set the classpath for that particular JVM only.
    Isn't it??? I want that of SYSTEM so that user can access that class path from any JVM instance.
    Prashant

Maybe you are looking for

  • Photoshop Elements 8 - is anyone having a problem with the screen color ?

         I just installed Elements 8 & the screen color has 2 choices: DARK (Black screen with Black & Grey text) LIGHT (Dark Grey screen with Black text) BOTH of these are VERY difficult to read & some text just dissapears into the background. After spe

  • Best way to JOIN with OWB 10.2

    Hi Gurus, im a newbie in working with OWB and i also apologize for my englisch. I have the following Issue. Im using Oracle warehousebuilder and i want to load data in a new Table as Table3 from two distinct source table Table1 and Table2. It should

  • Tax on sales/purchases

    While posting enty in f-22or f-43, m unable to view the tax line item while simulate the documetns. Checked all the configuration , but did't find the any configuration mistake

  • Coding block fields in recurring documents

    I have a recurring document created with some coding block fields.During the entry (FBD1)  ,those fields are open and was able to enter the data .During display (FBD3),the data is there.But when I posted some documents(Batch session) using the refere

  • Embed SWF in Firefox & Safari is Tiny

    I am using some swf files as buttons in flex as follows, and they look fine in Firefox when testing from Flex Builder, and in IE(6&7) when run, but in Firefox & Safari the embedded swf are tiny, 1px high and a few wide when I view them from a web ser