Java claims WORA

Discussion in 'Java' started by owais, Jun 20, 2012.

  1. owais

    owais Guest

    Java claims WORA (write once and run anywhere). Do you agree with this statement that all java programs can be run anywhere (all platforms)? Can you identify a scenario where this claim may not hold true?
     
    owais, Jun 20, 2012
    #1
    1. Advertising

  2. On Wednesday, June 20, 2012 5:33:02 PM UTC+2, owais wrote:
    > Java claims WORA (write once and run anywhere). Do you agree with this statement that all java programs can be run anywhere (all platforms)? Can you identify a scenario where this claim may not hold true?


    I find the question quite strange. Something tells me that you are asking a homework question... Oh, I see:
    http://vusols.blogspot.de/

    Please do your own research.

    Cheers

    robert
     
    Robert Klemme, Jun 20, 2012
    #2
    1. Advertising

  3. On Wed, 20 Jun 2012 08:33:02 -0700 (PDT), owais <>
    wrote:

    >Java claims WORA (write once and run anywhere). Do you agree with this

    statement that all java programs can be run anywhere (all platforms)?
    Can you identify a scenario where this claim may not hold true?

    Since it is your homework, how about you do it?

    Sincerely,

    Gene Wirchenko
     
    Gene Wirchenko, Jun 20, 2012
    #3
  4. owais

    Lew Guest

    On Wednesday, June 20, 2012 8:33:02 AM UTC-7, owais wrote:
    > Java claims WORA (write once and run anywhere). Do you agree with this statement that all java programs can be run anywhere (all platforms)? Can you identify a scenario where this claim may not hold true?


    It is spelled "Java".

    I am not aware of a Java port to the PDP-8.

    --
    Lew
     
    Lew, Jun 20, 2012
    #4
  5. owais

    Arne Vajhøj Guest

    On 6/20/2012 11:33 AM, owais wrote:
    > Java claims WORA (write once and run anywhere). Do you agree with this statement that all java programs can be run anywhere (all platforms)? Can you identify a scenario where this claim may not hold true?


    Java programs written and build for a specific Java version will run
    where that Java version or is available (and typical also if a newer
    version is available).

    Java is available for all the most common platforms.

    Arne
     
    Arne Vajhøj, Jun 20, 2012
    #5
  6. Arne Vajhøj <> wrote:
    > On 6/20/2012 11:33 AM, owais wrote:
    >> Java claims WORA (write once and run anywhere).

    > Do you agree with this statement

    (snip)

    > Java programs written and build for a specific Java version will run
    > where that Java version or is available (and typical also if a newer
    > version is available).


    > Java is available for all the most common platforms.


    So common, but not all.

    Is there Java for VAX/VMS?
    As I understand it, there are web browsers that run on VMS.

    Java requires IEEE floating point, so it tends not to be available
    on hosts that have a different floating point format.

    Most likely never for, for example, the IBM 7090. (Which would
    be batch mode, and not browser/applet, but still.)

    -- glen
     
    glen herrmannsfeldt, Jun 20, 2012
    #6
  7. On Wed, 20 Jun 2012 21:45:00 +0000, glen herrmannsfeldt wrote:

    > Most likely never for, for example, the IBM 7090. (Which would be batch
    > mode, and not browser/applet, but still.)
    >

    More to the point, are any still running?





    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
     
    Martin Gregorie, Jun 20, 2012
    #7
  8. On 21.06.2012 00:25, Martin Gregorie wrote:
    > On Wed, 20 Jun 2012 21:45:00 +0000, glen herrmannsfeldt wrote:
    >
    >> Most likely never for, for example, the IBM 7090. (Which would be batch
    >> mode, and not browser/applet, but still.)
    >>

    > More to the point, are any still running?


    Probably: there's nobody around any more who knows how to switch them off...

    robert

    --
    remember.guy do |as, often| as.you_can - without end
    http://blog.rubybestpractices.com/
     
    Robert Klemme, Jun 20, 2012
    #8
  9. owais

    Arne Vajhøj Guest

    On 6/20/2012 5:45 PM, glen herrmannsfeldt wrote:
    > Arne Vajhøj <> wrote:
    >> On 6/20/2012 11:33 AM, owais wrote:
    >>> Java claims WORA (write once and run anywhere).

    >> Do you agree with this statement

    > (snip)
    >
    >> Java programs written and build for a specific Java version will run
    >> where that Java version or is available (and typical also if a newer
    >> version is available).

    >
    >> Java is available for all the most common platforms.

    >
    > So common, but not all.


    Yep.

    > Is there Java for VAX/VMS?
    > As I understand it, there are web browsers that run on VMS.


    VMS Alpha and VMS Itanium: yes

    VMS VAX: no

    But it is 20 years since Alpha came out.

    > Java requires IEEE floating point, so it tends not to be available
    > on hosts that have a different floating point format.


    That is supposed to be the reason why VAX did not get Java.

    But they could have emulated IEEE FP if they wanted to.

    Arne
     
    Arne Vajhøj, Jun 21, 2012
    #9
  10. owais

    Roedy Green Guest

    On Wed, 20 Jun 2012 08:33:02 -0700 (PDT), owais <>
    wrote, quoted or indirectly quoted someone who said :

    >Java claims WORA (write once and run anywhere).
    >Do you agree with this statement that all java programs
    >can be run anywhere (all platforms)? Can you identify a
    >scenario where this claim may not hold true?


    The caveats are:

    1. If your code is written for Java 1,7 you must have a Java 1.7+
    runtime. It might not be available for a given platform.

    2. a given JVM might have a bug that stops some particular program
    from working.

    3. If you use JNI, you must have the appropriate native code for the
    given platform.

    4. Java does requires the programmer to handle the WORA stuff
    explicitly for file names and line separators and encodings. Simple
    programs will work fine, but more complex ones must be aware.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    If you look in a computer programmer's freezer you will find all
    kinds of containers, but none of them labeled. They do the same thing
    creating files without labeling the encoding. You are just supposed to
    know. Ditto with the MIME type, the separator and comment delimiters and
    column names in CSV files. Ditto with the endian convention. Imagine how
    much more civilised life would have been if Martha Stewart were the first
    programmer.
     
    Roedy Green, Jun 21, 2012
    #10
  11. owais

    Roedy Green Guest

    On Thu, 21 Jun 2012 00:57:30 +0200, Robert Klemme
    <> wrote, quoted or indirectly quoted
    someone who said :

    >Probably: there's nobody around any more who knows how to switch them off..


    Where they the ones with the red mushroom you either pulled or pushed
    for emergency power off or was that the 360?
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    If you look in a computer programmer's freezer you will find all
    kinds of containers, but none of them labeled. They do the same thing
    creating files without labeling the encoding. You are just supposed to
    know. Ditto with the MIME type, the separator and comment delimiters and
    column names in CSV files. Ditto with the endian convention. Imagine how
    much more civilised life would have been if Martha Stewart were the first
    programmer.
     
    Roedy Green, Jun 21, 2012
    #11
  12. owais

    David Lamb Guest

    On 20/06/2012 7:46 PM, Roedy Green wrote:
    > On Thu, 21 Jun 2012 00:57:30 +0200, Robert Klemme
    > <> wrote, quoted or indirectly quoted
    > someone who said :
    >
    >> Probably: there's nobody around any more who knows how to switch them off..

    >
    > Where they the ones with the red mushroom you either pulled or pushed
    > for emergency power off or was that the 360?


    360. You had to call IBM to unlatch the emergency-off and figure out how
    many components blew out from the instant power cut.
     
    David Lamb, Jun 21, 2012
    #12
  13. owais

    Arne Vajhøj Guest

    On 6/20/2012 7:43 PM, Roedy Green wrote:
    > 4. Java does requires the programmer to handle the WORA stuff
    > explicitly for file names and line separators and encodings. Simple
    > programs will work fine, but more complex ones must be aware.


    It is not quite clear to me what "handle the WORA stuff
    explicitly" really means.

    But the Java API provides classes and methods that allow
    for platform independent handling of those.

    So by following good practice one should be OK.

    Arne
     
    Arne Vajhøj, Jun 21, 2012
    #13
  14. owais

    Roedy Green Guest

    On Wed, 20 Jun 2012 16:43:21 -0700, Roedy Green
    <> wrote, quoted or indirectly quoted
    someone who said :

    >The caveats are:


    for a more detailed answer see http://mindprod.com/jgloss/wora.html
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    If you look in a computer programmer's freezer you will find all
    kinds of containers, but none of them labeled. They do the same thing
    creating files without labeling the encoding. You are just supposed to
    know. Ditto with the MIME type, the separator and comment delimiters and
    column names in CSV files. Ditto with the endian convention. Imagine how
    much more civilised life would have been if Martha Stewart were the first
    programmer.
     
    Roedy Green, Jun 21, 2012
    #14
  15. owais

    Arne Vajhøj Guest

    On 6/20/2012 9:37 PM, Roedy Green wrote:
    > On Wed, 20 Jun 2012 16:43:21 -0700, Roedy Green
    > <> wrote, quoted or indirectly quoted
    > someone who said :
    >
    >> The caveats are:

    >
    > for a more detailed answer see http://mindprod.com/jgloss/wora.html


    More detailed but very misleading.

    #Java works with platform-specific \r \n line-ending conventions. You
    have the lineSeparator to help, but your code has to deal with \r\n
    (Windows), \n (Unix) and \r (Mac) conventions.

    You should be using readLine and println etc. not doing binary
    IO with line.separator!

    #Internet Explorer is so far out, they can’t even legally call it Java.

    I can not see why SUN/Oracle Java used by IE can not be called Java.

    #On some platforms the elements of the classpath are separated by
    semicolons, and others by colons. There was no need for this variety,
    since classpath is a purely Java invention.

    Classpath is a Java thingy but path separators are not.

    Arne
     
    Arne Vajhøj, Jun 21, 2012
    #15
  16. Am 20.06.2012 17:33, schrieb owais:
    > Java claims WORA (write once and run anywhere). Do you agree with this statement that all java programs can be run anywhere (all platforms)? Can you identify a scenario where this claim may not hold true?


    Java is more like WOTA for me - write once, test everywhere. It's quite
    acceptable for simple programs, but as soon as it gets more complex than
    this, there are subtle differences between Java installations on Windows
    and Linux, and from version to version. I've seen cases where Java does
    not size windows correctly on one version, but not on others for reasons
    that are not clear to me, where input focus handling was slightly
    different and inconsistent, where refresh handling and the order of
    requests is slightly different, where window placement may or may not
    work... In theory, Java is very nice for running everywhere, but you
    still need to test and need to tweak a bit to get it working consistently.
     
    Thomas Richter, Jun 22, 2012
    #16
  17. owais

    Jan Burse Guest

    owais schrieb:
    > Java claims WORA (write once and run anywhere). Do you agree
    > with this statement that all java programs can be run anywhere
    > (all platforms)? Can you identify a scenario where this claim
    > may not hold true?


    Java has different degrees of WORA. For example one might
    distinguish between headless Java and Java with a GUI.

    Headless Java has a broader WORA. If you accept that WORA
    also includes transforming bytecode, then via DEX you can
    run Java on an Android platforms.

    Java with a GUI has a narrower WORA. If you opt for Swing
    then you have a good portability on platforms such as Windows,
    Mac and Linux. SWT would be an alternative for Swing.

    But for Android you would need to rewrite the GUI. But then
    with an Android GUI you can cover tablets, phones etc..
    which isn't bad.

    An Architecture that works for both Swing (or SWT) and Android
    would look as follows:

    +---------------+
    + Swing GUI |
    +---------------+-+---------------+
    | Headless Part |
    +---------------+-+---------------+
    | Android GUI |
    +---------------+

    There are a couple of design patterns that help you with doing
    the above. For the headless part you have WORA, but you need
    to build two apps on top of it, a .jar (for Swing) and
    an .apk (for Android).

    The above recently worked for me.

    Bye
     
    Jan Burse, Jun 22, 2012
    #17
  18. In article <js29dm$1fo$>,
    Thomas Richter <-berlin.de> wrote:

    > Am 20.06.2012 17:33, schrieb owais:
    > > Java claims WORA (write once and run anywhere). Do you agree with
    > > this statement that all java programs can be run anywhere (all
    > > platforms)? Can you identify a scenario where this claim may not
    > > hold true?

    >
    > Java is more like WOTA for me - write once, test everywhere. It's
    > quite acceptable for simple programs, but as soon as it gets more
    > complex than this, there are subtle differences between Java
    > installations on Windows and Linux, and from version to version. I've
    > seen cases where Java does not size windows correctly on one version,
    > but not on others for reasons that are not clear to me, where input
    > focus handling was slightly different and inconsistent, where refresh
    > handling and the order of requests is slightly different, where
    > window placement may or may not work... In theory, Java is very nice
    > for running everywhere, but you still need to test and need to tweak
    > a bit to get it working consistently.


    I'll second the need for testing, but I've found that using layouts
    properly and respecting a component's preferred size greatly reduces
    the number of cross-platform problems. There's a recent example here:

    <https://groups.google.com/d/msg/comp.lang.java.programmer/BbU4GjYuD6E/H-QLV3BRmmsJ>

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Jun 22, 2012
    #18
  19. owais

    Jim Janney Guest

    Thomas Richter <-berlin.de> writes:

    > Am 20.06.2012 17:33, schrieb owais:
    >> Java claims WORA (write once and run anywhere). Do you agree with this statement that all java programs can be run anywhere (all platforms)? Can you identify a scenario where this claim may not hold true?

    >
    > Java is more like WOTA for me - write once, test everywhere. It's
    > quite acceptable for simple programs, but as soon as it gets more
    > complex than this, there are subtle differences between Java
    > installations on Windows and Linux, and from version to version. I've
    > seen cases where Java does not size windows correctly on one version,
    > but not on others for reasons that are not clear to me, where input
    > focus handling was slightly different and inconsistent, where refresh
    > handling and the order of requests is slightly different, where window
    > placement may or may not work... In theory, Java is very nice for
    > running everywhere, but you still need to test and need to tweak a bit
    > to get it working consistently.


    A few years ago I was assigned the task of getting a Swing-based
    program, developed under Windows, to run under Linux. At the time it
    represented perhaps 30 to 40 programmer-years of work: not large by some
    standards but not trivial either. Part of the build process included a
    small set of unit tests and a much larger set of what amounted to
    integration tests to load the program and run it through its paces:
    these were originally written using jfcUnit but had evolved to the point
    that no actual jfcUnit code was still in use. These tests normally took
    somewhat over an hour to run.

    It took me a few days to get the program to the point where you could
    run and use it under Linux. There were some custom DLLs written in C++
    that had to be recompiled, and a few odd things like Unicode constants
    in the source code that needed to be replaced with their hex versions.
    But I was never able to get the integration tests to pass, or even to
    fail in the same places consistently. There was an issue with dialogs
    that wouldn't go away -- I verified that the code to close them was
    running and as far as Java was concerned they seemed to be gone, but you
    could still see them on the screen. Also various random-seeming null
    pointer exceptions and such-like. After I'd been working on it for
    about four weeks management decided they didn't want it that much and
    abandoned the effort.

    The point here isn't that it can't be done. With enough time and
    support from management I could have found and fixed the problems, or we
    could have found someone who else who could. (I'm happy to say that
    sending it to customers without passing the tests first was never on the
    table.) But it certainly wasn't automatic. If you intend to deploy to
    multiple platforms my advice would be to test on each platform right
    from the start.

    --
    Jim Janney
     
    Jim Janney, Jun 23, 2012
    #19
  20. owais

    Roedy Green Guest

    On Fri, 22 Jun 2012 15:59:43 -0400, "John B. Matthews"
    <> wrote, quoted or indirectly quoted someone who
    said :

    >I'll second the need for testing, but I've found that using layouts
    >properly and respecting a component's preferred size greatly reduces
    >the number of cross-platform problems. There's a recent example here:


    one of the big problems is when you substitute a font, the characters
    are not the same size. I would like to normalize fonts to their true
    size so that when you substitute fonts, the actual real estate
    consumed varies only a little.

    Another would be a guaranteed to render all glyphs, even if it means
    substituting from some other font. Failing that at telling the truth.
    Java claims to render a glyph when all it does in render some generic
    glyph.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    Computers are machines that do exactly what you tell them,
    but they still can surprise you with the results.
    ~ Dr. Richard Dawkins 1941-03-26
     
    Roedy Green, Jun 24, 2012
    #20
    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. Weng Tianxiang
    Replies:
    12
    Views:
    1,440
  2. Replies:
    11
    Views:
    3,769
  3. Roedy Green

    Mac WORA

    Roedy Green, May 4, 2008, in forum: Java
    Replies:
    15
    Views:
    840
    John B. Matthews
    May 18, 2008
  4. Tom Anderson

    Re: WORA high performance

    Tom Anderson, May 30, 2008, in forum: Java
    Replies:
    2
    Views:
    341
    Tom Anderson
    Jun 1, 2008
  5. Roedy Green

    Font WORA blues.

    Roedy Green, Jul 27, 2008, in forum: Java
    Replies:
    5
    Views:
    321
    Roedy Green
    Jul 29, 2008
Loading...

Share This Page