Get Java Version within programme...

Hi, is it possible to retrieve the version of Java which is running from within a class?
For example, I want to say:
String javaVersion= // insert code here...
System.out.println("This version of java is:"+javaVersion);
Hope someone can help, thanks.

Hi!
This can be achieved with
String javaVersion = System.getProperty("java.version");Also have a look at:
http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html#getProperties()
Greez,
deesze

Similar Messages

  • 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

  • How to get Java Version of an application server using Function Module?

    Hi Friends,
    We are doing developments for system performance reporting for multiple BW Systems. For this purpose we need to get the JAVA Version for these multiple systems.
    If anyone tell us about any Function Module or Program that we can use to get this information?
    Thanks
    Nayan Joshi

    Hi,
    Calling an SAP Function Module from Java
    To call an SAP function module from a Java application, you first need SAP JCo (Java Connector); you can download it from SAP's site, though you need an account to do so.
    To actually open the connection, use the tip code shown here.
    Class jcoClass = Class.forName("com.sap.mw.jco.JCO", true, this.getClass().getClassLoader());
    Client client = JCO.createClient(clientNumber, user, passWord, lang, host, systemId);
    //all parameters are strings
    client.connect();
    Repository repository = new JCO.Repository("SAP", client);
    IFunctionTemplate functionTemplate = repository.getFunctionTemplate
    ("YOUR_FUNCTIONAL_MODULE_NAME");
    Function function = functionTemplate.getFunction();
    ParameterList parameterList = function.getImportParameterList();
    parameterList.setValue("value1", "INPUT_PARAM_NAME");
    parameterList.setValue("value2", "INPUT_PARAM_NAME2");
    client.execute(function);
    Regards,
    Marasa.

  • HT5797 Where might I get Java version 1.6.0_51 so PhotoShop will work again?

    After updating to OX 10.8 AKA: Mountain Lion, PhotoShop will not open/work. It requires a new version of Java. Apples support article says Java version 1.6.0_51 should work. (If I understand correctly.) I don't see anything on Oracle's website except "bug" reports.
    Thanks for any help.
    I hope I don't sound grumpy.

    Hi MrCraig!
    I have the link for the download of Java for OS X 2013-004 right here for you:
    Java for OS X 2013-004
    http://support.apple.com/kb/DL1572
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • Getting java version at runtime

    Can it be done?

    Sorry wrong one:
              String javaVersion = System.getProperty("java.version");
              if (javaVersion.compareTo("1.1.2") < 0)
                   System.out.println(getResourceString("versionWarning"));
    Klint

  • JNI Program to check java version

    Hai,
    I want to write one program to get java version using JNI.ie It should show what version is installed.
    Thanks in Advance

    You do not need JNI to do that:
    see http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()
              System.err.println(System.getProperty("java.version"));
              System.err.println(System.getProperty("java.vm.version"));--Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can I downgrade my Java version and Runtime Environment to 6?

    Hi, thanks for reading this in advance:
    I have a couple problems. Ever since Java Preferences was removed in one of Lion's updates I have been having trouble with java.
    How do I downgrade my java and runtime environment to java 6?
    When I go into terminal, and type java -version, this is what I get:
    java version "1.7.0_09"
    Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
    Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
    How do I downgrade the "java version" to 6 and how do I downgrade the SE Runtime Environment to 6?
    I accidentally installed 7 a couple days ago and I've been having trouble with some applications.
    Thank you so much.

    Dear Minionsman and everyone who reads this. I was so happy when i downgraded and i wanted to share it to all, I have found out why it says this in terminal
    java version "1.7.0_09"
    Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
    Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
    and why it says something different on java tester
    Its because java 7 blocks every java version below it.
    How do you downgrade?
    Well all you do is delete a few files
    INSTRUCTIONS BELOW
    1.Open Terminal
    2. Enter these commands
    sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
    sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
    sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI .plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
    3.
    Go to /Library/Internet Plug-Ins/ and delete the JavaAppletPlugin.plugin bundle.
    4.
    Go to /System/Library/Java/JavaVirtualMachines/ and delete anything whose name starts with jdk1.7.0 or says Java 7 or something similar.
    5. now go to terminal and type
    java -version
    6.it should say something like this
    java version "1.6.0_35"
    Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M4508)
    Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
    <Edited by Host>

  • Confused with Java versioning

    Hi All,
    I have downloaded JDK 5.0 update 22 from the following url:
    http://java.sun.com/javase/downloads/index_jdk5.jsp
    when the executable file gets downloaded it?s name is ?jdk-1_5_0_22-windows-i586-p?, which is fine, but the question is that when I give the following command:
    C:\Documents and Settings\User1>javac ?versionI get
    javac 1.5.0_22and when I give the command:
    C:\Documents and Settings\User1>java ?versionI get
    java version "1.5.0_22"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
    Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode, sharing)Does it mean that JDK 5.0 come with JRE 1.5.0?
    Does it mean that I am using Java 5 or Java 1.5?
    Any help that will clear this doubt, will be much appreciated.
    Thanx.

    BIJ001 wrote:
    At the beginning they promised to call it version 1.x as long as the binary compatibility is maintained.
    But version 1.2 they started to call it "Java 2" and so on ever since.Yes and no. The jdk was still called 1.2. The "Java 2" part did only mean 2nd generation, so JDK 1.3 was still Java 2.

  • Java version troubles

    I have just installed
    jdk-1_5_0_11-linux-i586.rpm.bin
    on my linux machine. Nevertheless, when I type on a command line
    java --version
    I get ' java version "1.4.2" '.
    What do I need to do to upgrade to java 1.5? (I have troubles executing programs with parametrized types -- they compile with -source 1.5 option, but don't execute).
    Thanks a million in advance!

    Thanks for replying! How do I alter my path? (Sorry,
    I'm a complete newbie.)It's dependent on the OS that you are using, and I think it also is dependent on the shell that you are using. Google on your OS and shell and change path.
    Do also check if you have a symbolic link from java to the correct version. That's often used on unix/linux based systems, but all of this is pure OS specific and doesn't involve java at all.
    Kaj

  • Can I get the Java version of mobile tv with the r...

    I would like to know how to get the Java version of mobile tv with the removed mobile tv application, so I can view the Sky EPG programme guide on my E90.
    Can anyone tell me how I can get it please. The version from sky will not work but reading other posts on here suggests that the java version might.
    Please help.
    Solved!
    Go to Solution.

    Sky have made it near impossible to get this application on current phones.
    Luckily for you the java version is available for download as part of this useful guide.
    The instructions are for the N95 but should work on an E90. I've got it working on an N82 and N96 at the moment.
    Just a note about the java app: It says it's for a sony but it works perfectly on a nokia. Not sure how it will look on the E90's big screen so if it doesn't work try the front screen.
    Message Edited by psychomania on 14-Nov-2008 10:42 AM

  • I am trying to revert my Java to 1.6 from 1.7. The System Preferences Java icon is disabled. But when I enter java -version in terminal it shows 1.6.0_65.  Please help me in giving explicit commands to get back my Java 1.6

    I earlier had a java 1.7 installed in my system.  I wanted to revert the version back to 1.6.  I downloaded the file JavaForOSX2014-001.dmg and installed it in my hard disk.  I am not sure where it has installed it but it has successfully done it.  When I open up the terminal and enter java -version it shows 1.6.0_65 version as the java version. 
    But in the System Preferences, Java is disabled and does not show the java as being installed.  Please guide me in getting my java 1.6 back.

    The preferences pain shows this message when I click on the Java icon -- “Java can’t be opened because it isn’t available".

  • I have been getting java.lang.ClassNotFoundException: ZeroApplet.class and java.lang.ClassNotFoundException: JavaToJS.class crashes with JRE version 1.6.0_26-b03-384-10M3425 VM executing a Java Applet. Is Apple aware of this problem? No longer supported?

    My web page uses a Java Applet to allow my visitors to replay chess games; the Chess Viewer Deluxe applet was written by Nikolai Pilafov some time ago and has been working properly for some time (until recently). I don't monitor this part of my site regularly so I am not sure when it began to fail. On his web site [http://chesstuff.blogspot.com/2008/11/chess-viewer-deluxe.html] he has a link to check LiveConnect object functionality (which fails for OBJECT tags). His recommendation is to "seek platform specific support which might be available from the JRE developers for your platform".
    I have been getting java.lang.ClassNotFoundException: ZeroApplet.class and java.lang.ClassNotFoundException: JavaToJS.class crashes with JRE version 1.6.0_26-b03-384-10M3425 VM executing a Java Applet. Until I checked the LiveConnect object functionality, I was unable to identify the source of the console error messages. This does seem to be the smoking gun.
    Is Apple aware of this problem? Are these classes no longer supported? Has anyone else had this problem? You can attempt to recreate the problem locally by going to my web page: http://donsmallidge.com/DonSmallidgeChess.html
    Thanks in advance for any help you can provide!
    Abbreviated Java Console output:
    Java Plug-in 1.6.0_26
    Using JRE version 1.6.0_26-b03-384-10M3425 Java HotSpot(TM) 64-Bit Server VM
    load: class ZeroApplet.class not found.
    java.lang.ClassNotFoundException: ZeroApplet.class
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:662)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:807)
        at sun.plugin.AppletViewer.createApplet(AppletViewer.java:2389)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
        at sun.applet.AppletPanel.run(AppletPanel.java:368)
        at java.lang.Thread.run(Thread.java:680)
    load: class JavaToJS.class not found.
    java.lang.ClassNotFoundException: JavaToJS.class
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:662)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:807)
        at sun.plugin.AppletViewer.createApplet(AppletViewer.java:2389)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
        at sun.applet.AppletPanel.run(AppletPanel.java:368)
        at java.lang.Thread.run(Thread.java:680)

    I just went up to check the LiveConnect object functionality page AND IT WORKED THIS TIME! I must confess, this is very mysterious. I will do some more checking and reply here if I can determine why it is working now (and more importantly, why it didn't work before).

  • I have a brand new iMac, Yosemite 10.10.1, Java Version 8, Update 25, however, I still get a window when I open Adobe Photoshop CS5, that indicates that I need to install Java SE 6 Runtime. Any suggestions?

    I have a brand new iMac, Retina 5K, Yosemite 10.10.1, with Java Version 8, Update 25, however, I still get a window when I open Adobe Photoshop CS5, that indicates that I need to install Java SE 6 Runtime. Any suggestions?

    Java should be downloaded directly from Apple:
    Java for OS X 2014-001

  • Any way to get Java Plug-In-like handling of jar versions?

    I have jars intended for use with the Java Plug-In with version #'s in properties files (computed by the various tooling for updating these on the server). The jars themselves have no notion of jar #.
    I would like to re-use these jars and version #'s with Java Web Start to avoid conditional GETs, but without jar diffing in this case (as I already have many small jars due to lack of jar diffing in the Java Plug-In).
    Is there any way I can get Java Web Start to act like the Java Plug-In in this regard (i.e. the jar version # is a statement from the server, the client does a normal GET against the jar URL if its own version is not that stated by the server)?
    [Don't get me wrong, jardiffing is cool, but having to do everything differently between Java Web Start and the Java Plug-In is [b]not cool.

    Best way IMO would be to create a Socket connection to it so that you could connect with a client app and feed in data that way

  • How to programatically get a Java version (Not default one) ?

    Hi, Java Guru,
    Does anyone know how to programatically get a Java verstion through its full path ?
    For example, there are 5 JVM installed on a user's machine:
    JRE1
    JRE2
    JRE3
    JRE4
    JRE5
    How do you know the Java version under JRE3 ?
    From command line, you can simply type
    JRE3/java -version
    But how to programtically ? (I thought about running a system call, then check the standout, but feel it is not reliable, is there any other way to do it ?)
    Thanks in advance.

    No. That is not waht I want. Using System.getProperties() only can get the default Java information.
    Assume there are many Java version installed on a user's machine and we know all java Path.
    JRE1/bin/java
    JRE2/bin/java
    JRE3/bin/java
    JRE4/bin/java
    JRE5/bin/java
    JREn/bin/java
    JREn/bin/java is the latest one installed, that is, default Java.
    I want to know the JRE3 version before I use it, then how do I know JRE3 version PROGRAMTICALLY ?
    Anyway, thanks for response.

Maybe you are looking for

  • HT204387 How to use iPad Bluetooth with Samsung devices?

    Please advice, why my iPad mini 4g new device dose not appear Bluetooth devices from Samsung? How can I transfer some of my old files from samsung note to my new iPad wirelessly ?

  • Document link to Func loc / equipment / work order

    Hi We need to print the documents attached in functional location/ equipment via work order. Kindly guide the process to implement the same. or I need the tables to link the document attached in functional location, equipment with work order / functi

  • Why can I not assign colour labels to some files

    When I try to assign a colour label to some files or folders, even icons, sometime it works, sometimes it doesn't.  I've tried from the contextual menu, from Get Info, from File > Label.  Sometimes, one method may work but it's puzzling when none wor

  • How to make a custom property editable/not editable in DRM

    Hi, How do we make a particular field i,e custom property category field as editable whereas make an another field i,e another custom propertyfield value as non editable in a same hierarchy within a particular version. user has an admin privilage in

  • Blank Illustrator Swatch Windows?

    I just upgraded my iMac to OSX Mountain Lion, and now, when I try to open a swatch window in Illustrator (5.1), the window is blank, like so: This happens with the default swatches as well as the Pantone ones. I've been able to load the same swatches