java -version

Discussion in 'Java' started by Francesco, May 6, 2008.

  1. Francesco

    Francesco Guest

    Hi
    How can I find the version of the java that is invoked by an applet
    from browser?
    Which is the difference between java -version and the version viewed
    in the Java console from browser (they are not the same) ?
    Thanks
    Bye
    Francesco, May 6, 2008
    #1
    1. Advertising

  2. Francesco, 06.05.2008 13:04:
    > Hi
    > How can I find the version of the java that is invoked by an applet
    > from browser?

    System.getProperty("java.version") or
    System.getProperty("java.runtime.version") (a bit more detailed)

    > Which is the difference between java -version and the version viewed
    > in the Java console from browser (they are not the same) ?


    Most probably "java -version" uses a different JDK because it is in the system path.
    Check your PATH environment

    Thomas
    Thomas Kellerer, May 6, 2008
    #2
    1. Advertising

  3. Francesco wrote:
    > How can I find the version of the java that is invoked by an applet
    > from browser?

    An applet can get it by System.getProperty(....). See
    <http://java.sun.com/docs/books/tutorial/deployment/applet/properties.html>.

    > Which is the difference between java -version and the version viewed
    > in the Java console from browser (they are not the same) ?

    I guess you installed more than one Javas.
    When calling "java ..." from command-line you get the one found through
    your PATH environment variable.
    When running an applet in a browser you get the one configured in your
    "Java Control Panel".

    --
    Thomas
    Thomas Fritsch, May 6, 2008
    #3
  4. Francesco

    Roedy Green Guest

    On Tue, 6 May 2008 04:04:15 -0700 (PDT), Francesco
    <> wrote, quoted or indirectly quoted someone who
    said :

    >Hi
    >How can I find the version of the java that is invoked by an applet
    >from browser?
    >Which is the difference between java -version and the version viewed
    >in the Java console from browser (they are not the same) ?


    see http://mindprod.com/applet/wassup.html
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, May 6, 2008
    #4
  5. Francesco

    Francesco Guest

    On 6 Mag, 13:27, Thomas Fritsch <> wrote:
    > Francesco wrote:
    > > How can I find the version of the java that is invoked by an applet
    > > from browser?

    >
    > An applet can get it by System.getProperty(....). See
    > <http://java.sun.com/docs/books/tutorial/deployment/applet/properties....>.
    >
    > > Which is the difference between java -version and the version viewed
    > > in the Java console from browser (they are not the same) ?

    >
    > I guess you installed more than one Javas.
    > When calling "java ..." from command-line you get the one found through
    > your PATH environment variable.
    > When running an applet in a browser you get the one configured in your
    > "Java Control Panel".
    >
    > --
    > Thomas


    Ok
    But I cannot access to Java Control Panel...
    Can I access to it from Command prompt?
    Francesco, May 6, 2008
    #5
  6. In IE got to tools -> Java Sun Console and when it opens it says at
    the top.
    Chase Preuninger, May 6, 2008
    #6
  7. Francesco

    Arne Vajhøj Guest

    Arne Vajhøj, May 7, 2008
    #7
  8. Arne Vajhøj wrote:
    > Francesco wrote:
    >
    >> How can I find the version of the java that is invoked by an applet
    >> from browser?
    >> Which is the difference between java -version and the version viewed
    >> in the Java console from browser (they are not the same) ?

    >
    >
    > http://www.vajhoej.dk/arne/eksperten/showversion/showversion.html
    > will tell you.
    >
    > And if you need to put it in your code, then you can see the source at:
    > http://www.vajhoej.dk/arne/eksperten/showversion/showversion.java !

    I get "404 Not found" here.
    You meant
    <http://www.vajhoej.dk/arne/eksperten/showversion/ShowVersion.java>,
    which works fine.

    --
    Thomas
    Thomas Fritsch, May 7, 2008
    #8
  9. Francesco

    Arne Vajhøj Guest

    Thomas Fritsch wrote:
    > Arne Vajhøj wrote:
    >> Francesco wrote:
    >>> How can I find the version of the java that is invoked by an applet
    >>> from browser?
    >>> Which is the difference between java -version and the version viewed
    >>> in the Java console from browser (they are not the same) ?

    >>
    >>
    >> http://www.vajhoej.dk/arne/eksperten/showversion/showversion.html
    >> will tell you.
    >>
    >> And if you need to put it in your code, then you can see the source at:
    >> http://www.vajhoej.dk/arne/eksperten/showversion/showversion.java !

    > I get "404 Not found" here.
    > You meant
    > <http://www.vajhoej.dk/arne/eksperten/showversion/ShowVersion.java>,
    > which works fine.


    Yep.

    I copy pasted and changed extension.

    Sorry.

    Arne
    Arne Vajhøj, May 7, 2008
    #9
  10. Lew wrote:
    > Thomas Fritsch wrote:
    >> Arne Vajhøj wrote:
    >>> Francesco wrote:
    >>>
    >>>> How can I find the version of the java that is invoked by an applet
    >>>> from browser?
    >>>> Which is the difference between java -version and the version viewed
    >>>> in the Java console from browser (they are not the same) ?
    >>>
    >>>
    >>> http://www.vajhoej.dk/arne/eksperten/showversion/showversion.html
    >>> will tell you.
    >>>
    >>> And if you need to put it in your code, then you can see the source at:
    >>> http://www.vajhoej.dk/arne/eksperten/showversion/showversion.java !

    >> I get "404 Not found" here.
    >> You meant
    >> <http://www.vajhoej.dk/arne/eksperten/showversion/ShowVersion.java>,
    >> which works fine.

    >
    > Web-page URLs aren't case sensitive. The first version does not result
    > in a 404 from here.


    They can be. They have to. Imagine a *nix based web server with A.html
    and a.html with different content.

    Arne
    Arne Vajhøj, May 7, 2008
    #10
  11. Wayne wrote:
    > Lew wrote:
    >> Thomas Fritsch wrote:
    >>> Arne Vajhøj wrote:
    >>>> Francesco wrote:
    >>>>
    >>>>> How can I find the version of the java that is invoked by an applet
    >>>>> from browser?
    >>>>> Which is the difference between java -version and the version viewed
    >>>>> in the Java console from browser (they are not the same) ?
    >>>>
    >>>>
    >>>> http://www.vajhoej.dk/arne/eksperten/showversion/showversion.html
    >>>> will tell you.
    >>>>
    >>>> And if you need to put it in your code, then you can see the source at:
    >>>> http://www.vajhoej.dk/arne/eksperten/showversion/showversion.java !
    >>> I get "404 Not found" here.
    >>> You meant
    >>> <http://www.vajhoej.dk/arne/eksperten/showversion/ShowVersion.java>,
    >>> which works fine.

    >>
    >> Web-page URLs aren't case sensitive. The first version does not
    >> result in a 404 from here.

    >
    > The host name part of a URL isn't case sensitive, but rest is
    > including the filename. Some web servers will match in a case-
    > insensitive way if some option is on. (mod_speling in Apache,
    > MS IIS by default.)


    It is completely server specific whether it is case sensitive
    or not.

    Default (no special options) would likely be case sensitive
    on case sensitive file systems and not case sensitive on
    non case sensitive file systems. You can always count on
    developer laziness.

    Arne
    Arne Vajhøj, May 7, 2008
    #11
  12. On May 7, 6:57 pm, Arne Vajhøj <> wrote:
    > Wayne wrote:
    > > Lew wrote:
    > >> Thomas Fritsch wrote:
    > >>> Arne Vajhøj wrote:
    > >>>> Francesco wrote:

    >
    > >>>>> How can I find the version of the java that is invoked by an applet
    > >>>>> from browser?
    > >>>>> Which is the difference between java -version and the version viewed
    > >>>>> in the Java console from browser (they are not the same) ?

    >
    > >>>>http://www.vajhoej.dk/arne/eksperten/showversion/showversion.html
    > >>>> will tell you.

    >
    > >>>> And if you need to put it in your code, then you can see the source at:
    > >>>>http://www.vajhoej.dk/arne/eksperten/showversion/showversion.java!
    > >>> I get "404 Not found" here.
    > >>> You meant
    > >>> <http://www.vajhoej.dk/arne/eksperten/showversion/ShowVersion.java>,
    > >>> which works fine.

    >
    > >> Web-page URLs aren't case sensitive.  The first version does not
    > >> result in a 404 from here.

    >
    > > The host name part of a URL isn't case sensitive, but rest is
    > > including the filename.  Some web servers will match in a case-
    > > insensitive way if some option is on.  (mod_speling in Apache,
    > > MS IIS by default.)

    >
    > It is completely server specific whether it is case sensitive
    > or not.
    >
    > Default (no special options) would likely be case sensitive
    > on case sensitive file systems and not case sensitive on
    > non case sensitive file systems. You can always count on
    > developer laziness.
    >
    > Arne


    Per the semantics defined in RFC 2616, the path part of an HTTP URL is
    intended to be case sensitive regardless of server behaviour:

    3.2.3 URI Comparison

    When comparing two URIs to decide if they match or not, a client
    SHOULD use a case-sensitive octet-by-octet comparison of the entire
    URIs, with these exceptions:

    - A port that is empty or not given is equivalent to the default
    port for that URI-reference;

    - Comparisons of host names MUST be case-insensitive;

    - Comparisons of scheme names MUST be case-insensitive;

    - An empty abs_path is equivalent to an abs_path of "/".

    Well, okay, it is a "SHOULD" and not a "MUST". However, many
    important pieces of software, including caching proxies and most
    search engines, will treat URLs that differ by case as being distinct
    resources. Google, for example, will assign pagerank to both
    resources separately, and squid will cache both separately.

    This shows up in other places URLs are used: XML Namespaces that are
    identified by a URL are completely case-sensitive, even within the
    host portion, for example. In general, unless you have specific
    knowledge of the URL scheme in use, it's best to assume that URLs are
    case sensitive even if the software that's interpreting them isn't.

    -o
    Owen Jacobson, May 8, 2008
    #12
  13. Francesco

    Arne Vajhøj Guest

    Owen Jacobson wrote:
    > On May 7, 6:57 pm, Arne Vajhøj <> wrote:
    >> Wayne wrote:
    >>> Lew wrote:
    >>>> Thomas Fritsch wrote:
    >>>>> Arne Vajhøj wrote:
    >>>>>> Francesco wrote:
    >>>>>>> How can I find the version of the java that is invoked by an applet
    >>>>>>> from browser?
    >>>>>>> Which is the difference between java -version and the version viewed
    >>>>>>> in the Java console from browser (they are not the same) ?
    >>>>>> http://www.vajhoej.dk/arne/eksperten/showversion/showversion.html
    >>>>>> will tell you.
    >>>>>> And if you need to put it in your code, then you can see the source at:
    >>>>>> http://www.vajhoej.dk/arne/eksperten/showversion/showversion.java!
    >>>>> I get "404 Not found" here.
    >>>>> You meant
    >>>>> <http://www.vajhoej.dk/arne/eksperten/showversion/ShowVersion.java>,
    >>>>> which works fine.
    >>>> Web-page URLs aren't case sensitive. The first version does not
    >>>> result in a 404 from here.
    >>> The host name part of a URL isn't case sensitive, but rest is
    >>> including the filename. Some web servers will match in a case-
    >>> insensitive way if some option is on. (mod_speling in Apache,
    >>> MS IIS by default.)

    >> It is completely server specific whether it is case sensitive
    >> or not.
    >>
    >> Default (no special options) would likely be case sensitive
    >> on case sensitive file systems and not case sensitive on
    >> non case sensitive file systems. You can always count on
    >> developer laziness.
    >>
    >> Arne

    >
    > Per the semantics defined in RFC 2616, the path part of an HTTP URL is
    > intended to be case sensitive regardless of server behaviour:
    >
    > 3.2.3 URI Comparison
    >
    > When comparing two URIs to decide if they match or not, a client
    > SHOULD use a case-sensitive octet-by-octet comparison of the entire
    > URIs, with these exceptions:


    > Well, okay, it is a "SHOULD" and not a "MUST".


    Even if it had been "MUST" then it had not mattered.

    They keyword is *client*.

    If it is allowed for a server to have case sensitive path, then the
    client should/must consider it case sensitive.

    You can not conclude that it should/must or is intended to be
    case sensitive on the server.

    > This shows up in other places URLs are used: XML Namespaces that are
    > identified by a URL are completely case-sensitive, even within the
    > host portion, for example.


    Which violates the section you just quoted.

    > In general, unless you have specific
    > knowledge of the URL scheme in use, it's best to assume that URLs are
    > case sensitive even if the software that's interpreting them isn't.


    That is good advice. But it is still not case sensitive.

    Arne
    Arne Vajhøj, May 8, 2008
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lloyd Sheen

    Express Version Kills Current Version

    Lloyd Sheen, Jun 29, 2004, in forum: ASP .Net
    Replies:
    11
    Views:
    560
    Ken Cox [Microsoft MVP]
    Jul 2, 2004
  2. Ily
    Replies:
    2
    Views:
    432
    Eliyahu Goldin
    Jul 27, 2005
  3. V Green
    Replies:
    0
    Views:
    842
    V Green
    Feb 5, 2008
  4. PA Bear [MS MVP]
    Replies:
    0
    Views:
    956
    PA Bear [MS MVP]
    Feb 5, 2008
  5. MowGreen [MVP]
    Replies:
    5
    Views:
    2,017
    PA Bear [MS MVP]
    Feb 9, 2008
Loading...

Share This Page