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?

Similar Messages

  • Batch command for using Java in IE

    Hello,
    I'm looking for a batch command that sets IE to use Java (Sun).
    It should do the same job as if manually checking the check box of 'Use <java version> for applet' in advanced internet options of IE.
    Is there a way to do it?

    Sorry, currently there's no batch command to set IE to use Java from Sun.
    There're quite a few registry keys need to be set when that option is selected.
    Registry settings for:
    - turning off console for MSVM;
    - hooking up Sun's Java console to IE;
    - adding a "TreatAs" to the Web Browser Applet Control so that applets with applet tag will use Sun's Java;
    etc.

  • Command to find File versions in Linux

    Will any one tell me the command to find the file versions of the following files:
    - POXVDCKB.pls
    - POXWPA9B.pls
    I am new to Financials app. Thanks in advance
    Regards,
    BMP

    oa.jsp is helpful in determining the version of Self Service Framework you are using. To check that out, use the table listed below:
      OA.jsp Version    Framework Version   Patch Number
         115.61           11.5.10.5RUP         5473858
         115.60           11.5.10.4RUP         4676589
         115.58           11.5.10.3RUP         4334965 / 5125546
         115.56           11.5.10H             3262919
         115.39           11.5.10G             3516965
         115.36           5.7H                 2771817 (11.5.9)
         115.27           5.6E                 2278688 (11.5.8)
         115.26           5.5.2E               2227335
         115.20           5.5.2C               2085104
         115.19           5.5.2B               2041847
         115.11           5.5.1E
         115.10           5.5.1B
         115.9            5.5.1A
         115.8            5.5.0E
         115.7            5.5.0D
         115.6            5.5.0C
         115.5            5.2.3D
         115.4            5.2.3C You can also check the version of OA Framework you currently have installed by logging in to your 11i instance and navigate to OAInfo.jsp using the following:
    http://hostname.domainname:port/OA_HTML/OAInfo.jsp

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

  • 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

  • A command for finding an application's version number?

    Hello,
    I need a command for finding the version number of a specific application installed in OS X, and I need to be able to run it via the UNIX feature of Apple Remote Desktop, so that I can run it on hundreds of computers. First I tried this:
    system_profiler -detailLevel full
    It works, but it takes a long time to produce the output, because it's gathering and outputting all of the information that System Profiler provides. I don't know if there's a way to narrow it down so that it only gives me the version number of the specific application I need to know about. This is an example of what the output looks like for each application listed.
        iPhoto:
          Version: 9.2.1
          Last Modified: 10/27/11 10:05 AM
          Kind: Intel
          64-Bit (Intel): No
          App Store: No
          Location: /Applications/iPhoto.app
    Copying that to TextEdit and searching for the application's name takes way too long, especially for hundreds of computers. Are there any arguments or regular expressions I could add to the command to narrow it down, and make it only output the information I need?
    Someone suggested this command, which takes the information from Spotlight:
    mdls -name kMDItemVersion <path to file>
    That works for apps in the Applications folder, but the application I need the version number for is in the /usr/bin folder and I'm guessing that's not indexed by Spotlight, because it returns:
    kMDItemVersion = (null)
    Any help would be greatly appreciated!
    -Mike

    You rock! I'm definitely on the right track now. Yes, it's a regular application package, not a UNIX executable. Ok, so I use this command to display the Info.plist file inside that package:
    cat /usr/bin/uc/UndercoverRegistration.app/Contents/Info.plist
    And it outputs this:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
        <key>CFBundleExecutable</key>
        <string>UndercoverRegistration</string>
        <key>CFBundleIconFile</key>
        <string>Undercover</string>
        <key>CFBundleIdentifier</key>
        <string>com.orbicule.UndercoverRegistration</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>4.5</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>4.5</string>
        <key>NSMainNibFile</key>
        <string>MainMenu</string>
        <key>NSPrincipalClass</key>
        <string>NSApplication</string>
    </dict>
    </plist>
    So can I add arguments to that command to have it only display the version number, which is on line 18 (the value is 4.5 here)? So would I be able to display only line 18, or display whatever is below the line that reads "<key>CFBundleShortVersionString</key>"? Thanks!

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

  • How to find the version of a package

    Hi ,
    Please let me know the command to find the version of a package.
    For Example I want to know the version of ARPURG.pls file .
    Thanks
    Naveen.

    Unix: strings -a ARPURG.pls | grep -i Header
    Windows: find "Header" ARPURG.pls | more

  • How do I find what version of Java I have on my iMac?

    How do I find what version of Java I have on my iMac (OSX 10.9.1)?

    If you installed the Oracle Java runtime, there's a preference pane named Java in System Preferences.

  • How can I find out the java version Oracle has ?

    How can I find out the java version Oracle has built in?
    I've tried with ..
    SELECT comp_id, comp_name, version
    FROM dba_registry ;
    But I get.."table doesn't not exist".
    Thenks in advance!

    Pl post details of OS and database versions. Pl see this MOS Doc
    What Version of Java is Compatible With The Database JVM? [ID 438294.1]     
    and these Oracle docs
    11gR2 - http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/adfns_environments.htm#ADFNS654
    11gR1 - http://docs.oracle.com/cd/B28359_01/java.111/b31225/whatsnew.htm
    HTH
    Srini

  • Java side batch commands? I.e.: open FILE

    Is there a way to add commands for a batch file into a java code?
    Like...
    If i was going to make a code to open a text file, in a ms-dos/batch file i would put
    open FILENAMESo is there a way i can make it use the batch to open a file, but without clicking the batch to do it.
    For example;
    Im going to have my own game, people will have the open in the batch file of the game client, so they can just edit so it dosn't do it, but the client will be obfuscated and closed source, so they wont be able to edit that'
    Thanks for any help.

    Ok, this is a simple batch file;
    @echo off
    echo this is a simple batch file
    *open file.txt*
    *del file2.txt*
    pauseI want to execute those bits in **'s* in a java file, so someone can't just right click the batch file and edit them out.
    I hope you understand me now.

  • Java -version bash: java: command not found

    Hi all.
    I wanna install java on linux (OpenSUSE). When I checked java -version, it shown that :
    java -version
    bash: java: command not found
    Can any solution about it, please!

    Sukirmanster wrote:
    I wanna install java on linux (OpenSUSE). When I checked java -version, it shown that :
    java -version
    bash: java: command not foundNot surprising if you have not installed java yet.
    Can any solution about it, please!If you have installed java, read a unix/linux manual,
    pay particular attention to bash (or any shell) and the role of $PATH.

  • Unix command to find version of Informatica, Cognos and DataStage on SUN 5.

    How do I find the version of Informatica, Cognos and DataStage using a unix command on my Unix machine SunOS 5.8.
    I don't want to use front end to find this information.

    Um ... typically you would ask the Informatica, Cognos and DataStage people. (All of whom are not part of Oracle afaik ... [yet])

  • Java -version is it a java command or OS command.

    java -version is it a java command or OS command.
    I am in a bet. I said its a java command and it will be same no matter what the OS is. What do u genius say

    java -version is it a java command or OS command.
    I am in a bet. I said its a java command and it will
    be same no matter what the OS is. What do u genius sayWhat do you mean "java command." There isn't really such thing as a "java command." At least, the term does not have a standard definition.
    java is the name of the executable that is the JVM. It wouldn't have to be. You could change it to whatever you like. You could also change it so that "java" invoked some other executable.
    The -version argument is supported by Sun's VM on several OSes, but it is not inherent to Java, it wouldn't have to be supported on all VMs, or on all OS versions of a specific VM. Is there a VM out there that doesn't support -version? I don't know, but there could be. And if there's not today, there could be tomorrow. There's certainly no requirement that a VM support that option.
    In short, the answer to your question is [url http://en.wikipedia.org/wiki/Mu]Mu.

  • "java -version" command result in error stream

    i am getting output of following command in error stream instead of input stream
    Runtime rt = Runtime.getRuntime();
                   ProcessBuilder builder = new ProcessBuilder(new String[]{"cmd.exe","/c","java -version"});
                   Process pr = builder.start();
                   BufferedReader input = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
                   String line=input.readLine();
                   System.out.println(line);
    please explain
    Edited by: Mayur Mitkari on Feb 27, 2013 5:25 AM

    Using System class you can work with 3 different types of streams to read or print data
    System.in : Standard Input Stream - open and ready to supply input data
    System.out : Stand Output Stream - open and ready to accept output data
    System.err : Stand Error Stream - open and ready to accept output data
    Generally output stream may be set with any output device or file. Based on the stream which are using the output will be redirected to the corresponding stream.
    Here in your program you are printing the data using "System.out" - nothing but standard output stream so what ever the output come through your program will be redirected to the default output device.
    Input streams are used to read the data. For example, assume that you want to read the data from the keyboard then you can read like the below
    Scanner scanner = new Scanner(System.in);
    while(scanner.hasNext())
         System.out.println(scanner.next());
    }

Maybe you are looking for

  • String is not null forever?

    String a = ""; String b = new String(); a==null? false b==null? false why?

  • DELETE TABLE STATEMENT WITHIN A LOOP IN A PROCEDURE

    i am using delete table tablename statement inside a cursor for loop which is inside a procedure it is telling error in that delete statement can't i put it inside the loop

  • Generating Oracle reports o/p to xls format.

    Hi all, I have few reports which run while being called from forms.All the reports display a parameter form before generating the o/p. Is there any way using which one can generate the o/p in MS-Excel format. Thanks in advance. Rajeev

  • Creating Personal Profile Pages

    Hello, I'm using DW CS3 with the Toolbox extension. Basically, I want to create a site where users can post their own profile page. Each user would need to register, then login. I can create the login, profile and edit profile pages, no problem; but

  • Corruption of weblinks containing '%20' when exporting from pages to pdf

    When I export a document in pages to a pdf file, embedded weblinks which contain the code '%20' as part of the web address (which I understand to be HTML code for a space?) these are converted to '%2520' which then leave the weblinks unusable. Any id