Is the output of java -version reliable?

Hi,
As part of an installer, I'm trying to write a script to check that the user's JRE is recent enough. With all JRE's I tried I noticed that the first line of output from: java -version is always of the form: java version "1.3.1" Can I rely on this to always be the case? I had a look through some of the specifications, but they are more concerned with how the JRE runs, not how you invoke it.
Cheers,
Gary

I think it's best to get the system property "java.version" and to check upon the result.
System.getProperty("java.version");

Similar Messages

  • Finding the minimum needed Java version to run app

    Hello, I have created an application and would like to distribute it. However, I would like to know the minimum Java version that would be needed to run the app. Aside from digging through the APIs, would there be any tool that would help with that task.
    (P.S. I'm sorry for any cross-posting that may occur, I did not know what this would fall under).

    Doesn't answer the question, which java version did you use?
    In eclipse, pull down the help menu and select About Eclipse SDK, then click the Configuration button. In the dialog that comes up near the top is a section with java.??? look for the one that say java.home and see which version of the jdk it's using, then go to your project, right click on it and to go properties. Under Java Compiler in the tree view you will see JDK compliance. That will tell you absolutely which version(s) of Java are involved. The one in the compiler compliance is the one that the system trying to run your application must have.
    PS.

  • What is the correct Sun Java version for Plus ?

    OK so I am running Version 1.4.2_06 (build 1.4.2_06-b03) for Disco Plus.. Is that the correct version ? I am trying to debug an error (Outstanding Refresh) and I need to eliminate the Java version being the cause:
    Can anyone confirm ? thanks OBX
    OracleBI Discoverer 10g (10.1.2.1)
    Oracle Business Intelligence Discoverer Plus 10g (10.1.2.48.18)
    Discoverer Model - 10.1.2.48.18
    Discoverer Server - 10.1.2.48.18
    End User Layer - 5.1.1.0.0.0
    End User Layer Library - 10.1.2.48.18
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi

    Hi OBX
    Yes that is the correct version, at least that's the one that comes out of the box. You can upgrade to later versions but you have to do this both on the server and on the client. One thing that you must not do is allow the client machines to upgrade when the server is still on 1.4.2_06
    I hope this helps
    Best wishes
    Michael Armstrong-Smith
    URL: http://learndiscoverer.com
    Blog: http://learndiscoverer.blogspot.com

  • Saving the output of java programs in files

    How I do save the output of a program to a MS - DOS file ?

    import java.io.*;
    use FileOutputStream /BufferedOutputStream class.....
    read tutorials or books about JAVA on these technology
    U can find many examples in this site too

  • Redirecting the output of java compilation to a text file

    i tried to redirect the result of the java compilation to the text file using
    javac zz.java > compile.txt
    It works if the program has no errors and it did not work if it have errors. Wat is the reason it did not work for wrong programs.

    This has nothing to do with Java. It's your command shell.
    If you're on linux, then it's because the errors go to stderr and you're only redirecting stdout. I assume Windows is similar, but I don't know much about that.
    For bourne shell family on linux (sh, ksh, bash, zsh), you'd do
    javac zz.java > compile.txt 2>&1I'm not sure what the syntax is for csh family.

  • New iMac (Lion - 10.8.2) - Pogo would not work as Java was not installed.  Went into Utilities - open Java Preferences - it has now disappeared - now where to be found.  I went into the Terminal - input 'java -version' - it says I have version 1.6.  Help!

    My Java and Java Preferences do not show up in my 'Utilities' folder nor can I have them in a search.  If I can't find them I can't enable Java.  Tips - Tricks!!

    System Preferences->Java

  • How can you upgrade the Oracle's db java version?

    Hi - Is there away to upgrade the database's java version? We are on UNIX with Oracle 8.1.6. I would like to upgrade it to Java 1.4, if possible. As far as I know, we do not currently use java for anything. We like to use java stored procedures.
    Thanks
    Aaron

    whoit wrote:
    Is it possible (and if so, how) to determine the version of Java used to compile a class file?
    I've recently had to install both JDK 1.5 and JDK 1.4 on my system, and although I've got my paths set, etc.
    I'd like to check my class files after compiling so I can rest assured that they were compiled with the appropriate version.
    Can this be done? How?
    Thanks.The answer is yes and no. You can check the VM compability/compliance version of the compiled class. But e.g a JDK 1.5 compiler can compile classes that are compatible with a 1.4 VM (but that doesn't mean that it is guaranteed to execute on that VM without any errors)
    Kaj

  • Which java version should I code the SCJD assignment?

    Hi All,
    I am planning to take SCJD (maybe within a year or earlier). But I am confused as to in which version of java should I submit the assignment(CX-310-252A). I read in "All in one Java 2 SCJP..." book by Kathy Seirra that we must not use a verison (of java) that is more than 18 months older than the current production java version as it would be deemed "out-of-date" by the exam assessors (pg 563).
    So going by the same line of thought, does it mean that I can submit the aasignment only in 1.6 (release date-dec 12 2006) and not in java 1.5 or 1.4. Also, if 1.7 gets released early next year and if I am coding in 1.6, then I would have to submit the assignment by june 2008 (or else it would become outdated).
    The various java version release dates can be found at: http://mindprod.com/jgloss/javareleasedates.html
    Please help me solve this version confusion. (I prefer submitting in 1.4 as I have completed SCJP 1.4)
    SCJP 85%, SCWCD 91%
    "Once we accept our limits, we go beyond them"

    1.5 is no longer a valid platform 18 months after the
    initial public release of 1.6.
    What that means is that your code should work on 1.6
    without modifications from that date.Where did you find that information?
    It's a bit strange since this is what The EOL for Java says:
    "Technology EOL Policy
    Major Product Family Releases
    This would include such products as Java 2 Platform,
    Standard Edition 1.4.2 and 5.0. The Java technology policy
    is to support the current shipping version of Java
    Standard Edition plus two back versions. Once the
    End-of-Life process starts on a major product family
    release, a notice will be posted on all relevant download
    pages stating that the product has entered the EOL
    process and how long the process will continue until the
    product is no longer supported by Sun."http://java.sun.com/products/archive/eol.policy.html
    So that means that 1.4.2 will enter EOL when Java 7 is released. How can a version that hasn't entered the EOL life cycle not be valid?
    Kaj

  • Calling BIP from Oracle Forms: Having Java version problem.

    <h3>
    Hi,
    I tried to call a BIP report through Oracle Forms.
    I followed this PDF.
    http://www.oracle.com/technology/products/xml-publisher/docs/Forms_BIP_v22.pdf
    Problem is, when I run the form, I get this error (copied from the Java Console)
    Oracle JInitiator: Version 1.3.1.22
    Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\channasiriwardena
    Proxy Configuration: Manual Configuration
    Proxy: 192.168.11.100:81
    Proxy Overrides: *.iil.informatics.lk,192.168.11.*,192.168.10.*,<local>
    JAR cache enabled
    Location: C:\Documents and Settings\channasiriwardena\Oracle Jar Cache
    Maximum size: 50 MB
    Compression level: 0 Forms Applet version is : 10.1.2.0
    java.lang.UnsupportedClassVersionError: oracle/j2ee/ws/client/ServiceFactoryImpl (Unsupported major.minor version 49.0)
    I am using Forms Forms [32 Bit] Version 10.1.2.0.2.
    JDeveloper Version is 10.1.3.5.0.
    The Forms 10g Java version is 1.4.
    So according to what I discovered on the net, the problem is: My JInitiator is 1.3 using JRE 1.3, BUT my .JAR file is Java 1.5.
    Since we are using the Oracle JVM, ticking “Use JRE 1.5..” in the Advanced tab of the Internet Explorer Options has no effect.
    We cannot upgrade the Oracle JInitiator to a 1.5 since there is no such JInitiator version. JInitiator is available only up to 1.3.1.30.
    What can I do. What if I install Java 1.3 in my machine and re-compile my JAR file with that? Will that work or is there another solution?
    Has anybody encountered this problem?
    Any help would be greatly appreciated.
    Thanks & Regards,
    C.S.
    </h3>

    Hi,
    Yes, you need to compile your source files with JDK 1.3 (since JInit 1.3.x.x uses JDK 1.3).
    Other solution would be to use JRE 1.5 (instead of JInitiator).
    Check out [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=550563] on how to use JRE1.5
    -Arun

  • How to add new Java version to Java Preferences?

    Greetings,
    I know Java 7 is not officially supported, but I know it works.
    I built 1.70.jre and put it in /Library/Java/JavaVirtualMachines, but I do not know how to add to  Java Preferences.
    Does anyone know where the list of Java versions is stored and how to add a version to it?
    Thanks

    Fixing the permissions did not fix it.
    I think there  to be a record somewhere of what version are where. That is probably set if you use am installer which I do not have. I only have the file I copied there.
    I found out that typing this in Terminal...
    export JAVA_HOME=/Library/Java/1.7.jre/Contents/Home
    ...temporarily sets that version to the one being used, but it is only for that Terminal session, and it still does not show in Java Preferences.
    I need to know how to get it into Java Preferences. It might be some command I don't know.

  • Calling BIP from Forms: Having Java version problem

    <h5> Hi,
    I tried to call a BIP report through Oracle Forms.
    I followed this PDF.
    http://www.oracle.com/technology/products/xml-publisher/docs/Forms_BIP_v22.pdf
    Problem is, when I run the form, I get this error (copied from the Java Console) </h5>
    <h6>
    Oracle JInitiator: Version 1.3.1.22
    Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\channasiriwardena
    Proxy Configuration: Manual Configuration
    Proxy: 192.168.11.100:81
    Proxy Overrides: *.iil.informatics.lk,192.168.11.*,192.168.10.*,<local>
    JAR cache enabled
    Location: C:\Documents and Settings\channasiriwardena\Oracle Jar Cache
    Maximum size: 50 MB
    Compression level: 0 Forms Applet version is : 10.1.2.0
    java.lang.UnsupportedClassVersionError: oracle/j2ee/ws/client/ServiceFactoryImpl (Unsupported major.minor version 49.0)
    </h6>
    <h5>
    I am using Forms Forms [32 Bit] Version 10.1.2.0.2.
    JDeveloper Version is 10.1.3.5.0.
    The Forms 10g Java version is 1.4.
    So according to what I discovered on the net, the problem is: My JInitiator is 1.3 using JRE 1.3, BUT my .JAR file is Java 1.5.
    Since we are using the Oracle JVM, ticking “Use JRE 1.5..” in the Advanced tab of the Internet Explorer Options has no effect.
    We cannot upgrade the Oracle JInitiator to a 1.5 since there is no such JInitiator version. JInitiator is available only up to 1.3.1.30.
    What can I do. What if I install Java 1.3 in my machine and re-compile my JAR file with that? Will that work or is there another solution?
    Has anybody encountered this problem?
    Any help would be greatly appreciated.
    Thanks & Regards,
    C.S.
    </h5>

    Hi
    You dont need JInitiator, just downloading and installing either JRE or JDK 1.5 will be enough.
    Another option might be to set the version you want to compile your classes against in JDeveloper. there is a setting in there to specify the java version you want to compile against.
    So are you using the web services from BIP inside Forms?
    Tim

  • Upgrade default java version in Solaris 8?

    I have Solaris 5.8 running on sun blade system. Default Java version is 1.2.2 and user need it to upgraded to latest version of Java so, I installed jre1.6.0 (combination of 32-bit install and 64 bit install). Now I can't point solaris to look at the newly installed java version. I have tried to change the path variable in .cshrc but it is readonly to root and group is deamon. I also tried changing the symbolic link from /usr/java to /usr/jre1.6.0 but it is still looking at default version of java1.2.2.
    I need help as I don't know much about Solaris to upgrade this java. Any help or guidance is greatly appreciated.
    Thanks,
    solaris_newbee

    After installing, you need to update the '/usr/java' sym link to point to your new root installation. For example, I installed jdk1_5_16 at /usr/jdk/jdk1.5.0_16/ and then added this symlink:
    ln -s /usr/jdk/jdk1.5.0_16/ /usr/java
    You may need to remove the symlink that is already there before it will allow you to successfully create the new one.
    There are several other dependent symlinks in /usr/bin that use /usr/java, but you only have to update /usr/java.
    From one noob to another.

  • "9iAS Forms/Reports version" vs "9iAS Java Version"

    Everybody knows that Oracle pushing for the JDeveloper 9i and 9iAS. The new "9iAS Java Version" for 5,000 dollars per CPU is a great price.
    When Oracle is going to release a "9iAS Forms/Reports Version", which will include 5 developer licenses for Forms/Reports Developer 9i (not the entire 9iDS) and the 9iAS framework to deploy only the 9i forms and/or reports but nothing else - for 5,000 dollars?
    As it is proven by the release of 9iAS Java Version, it is really not a technical issue - but a marketing decision to have a "9iAS Forms/Reports Version". Anybody from Oracle marketing?

    At Oracle Open World, they said they will have a new BI package of the Application Server which will include HTTP, Web Cache, Discoverer, and Reports. It will also include 5 developer licenses so I'm guessing there will be a similar packaging of the Developer Suite. It may include JDeveloper too but I don't know.
    So if you aren't using Forms, there will be one option to get Report Server cheaper than you can today. It is supposed to be released in January. If it includes JDeveloper, then you can migrate your Forms to J2EE and use this installer too.

  • Get Java Version from Applet to JSP

    Hi Forum!
    I am trying to collect client information with a jsp page and put the information into a html form.
    Besides the request information and some javascript screensize and flash version information I'd like to get the client's Java Version and Vendor with System.getProperty("java.version").
    I assume I can get this info only with an applet.
    How do I pass the Applet's version result to the JSP so I can view it with HTML and insert it into the form?
    Thanks a lot,
    Tom

    You would use liveconnect and the JSObject class to connect the Java code in the applet to JavaScript in the browser to populate the HTML:
    http://www.gsu.unibel.by/pub/javascript/ch19_06.htm
    http://www.apl.jhu.edu/~hall/java/JavaScript-from-Java.html

  • Redirect based on Java Version

    I have users running both Sun Java 1.4.1_07 and 1.4.2_08. I would like to create a HTML page that redirects these users based on what version of java they are running on their machine.
    I.E. If user A is running 1.4.1_07 they get redirected to a certain page, and if user B is running 1.4.2_08 they get redirected to a certain page.
    Any input would be appreciated.
    Thanks

    I would think that a small applet that checks the version would be your best bet. I'm pretty sure that applets are allowed to get some System properties by default - the Javadoc for getProperties() has the list - perhaps java.version.

Maybe you are looking for

  • IPC error

    I am getting the error in alert log file. ORA-27508: IPC error sending a message ORA-27300: OS system dependent operation:IPCSOCK_Send failed with status: 10054 ORA-27301: OS failure message: An existing connection was forcibly closed by the remote h

  • ActiveX RDP Fullscreen Resolution

    This is not a question, but a very simple solution to a problem that had us scratching our heads for quite a while.  Hopefully this will save someone else some time figuring it out. We use the Clientless SSL VPN with a terminal server for our general

  • Deleting Past Dates from an iCal calendar

    I have just imported the date book from my palm (10 years worth). It was a little tricky at first (I had to create a new palm user and then export that file-- not my main file.) But it did import into iCal as an "other" calendar. Here is my question.

  • ColdFusion certification

    Hi, Apologies if this isn't in the correct forum. I've recently started my career in IT, and currently have 2 years experience of using ColdFusion. I decided to schedule my Adobe coldfusion exam, and I am going to be sitting it in a week's time. Anyw

  • Need help with updates and new apple programs

    something happened to my pc. having problems with my pc when it restarts. wondered if anyone whichapple updates require a restart, and which don't? if they require a restart to finish installation, they fail, and my pc crashes, and i have to resintal