Works for me

Discussion in 'Java' started by Lawrence D'Oliveiro, Feb 8, 2011.

  1. root@theon:~ # dpkg-query -s sun-java6-jdk
    Package: sun-java6-jdk
    Status: install ok installed
    Priority: optional
    Section: non-free/java
    Installed-Size: 59940
    Maintainer: Debian Java Maintainers <pkg-java-
    >
    Architecture: amd64
    Source: sun-java6
    Version: 6.22-1
    Provides: java-compiler, java-sdk, java2-compiler, java2-sdk, java5-sdk,
    java6-sdk
    Depends: sun-java6-bin (>= 6.22-1), libc6, libx11-6
    Pre-Depends: debconf (>= 0.5) | debconf-2.0
    Suggests: sun-java6-demo, openjdk-6-doc, sun-java6-source
    Description: Sun Java(TM) Development Kit (JDK) 6
    The JDK(TM) is a development environment for building applications,
    applets, and components using the Java programming language.
    .
    The JDK includes tools useful for developing and testing programs
    written in the Java programming language and running on the Java
    Platform.
    .
    NOTE: You must accept Sun's EULA prior to successfully installing
    this package
    Homepage: https://jdk-distros.dev.java.net

    ldo@theon:java_try> cat test.java
    class test
    {
    public static void main(String[] args)
    {
    System.out.print("Got...");
    double c = 2.2250738585072011e-308;
    System.out.println(" here.");
    } /*main*/
    }

    ldo@theon:java_try> javac test.java
    ldo@theon:java_try> java test
    Got... here.
     
    Lawrence D'Oliveiro, Feb 8, 2011
    #1
    1. Advertising

  2. Lawrence D'Oliveiro

    Paul Cager Guest

    On Feb 8, 9:16 am, Lawrence D'Oliveiro <l...@geek-
    central.gen.new_zealand> wrote:
    > root@theon:~ # dpkg-query -s sun-java6-jdk
    > Package: sun-java6-jdk
    > Status: install ok installed
    > ...
    > Architecture: amd64


    That proves that you have installed Sun's Java, but does not mean that
    you are using it by default. A "java -version" (or an "update-java-
    alternatives") would have helped prove your point.
     
    Paul Cager, Feb 8, 2011
    #2
    1. Advertising

  3. Lawrence D'Oliveiro

    Nigel Wade Guest

    On 08/02/11 09:16, Lawrence D'Oliveiro wrote:
    > root@theon:~ # dpkg-query -s sun-java6-jdk
    > Package: sun-java6-jdk
    > Status: install ok installed
    > Priority: optional
    > Section: non-free/java
    > Installed-Size: 59940
    > Maintainer: Debian Java Maintainers <pkg-java-
    > >
    > Architecture: amd64
    > Source: sun-java6
    > Version: 6.22-1
    > Provides: java-compiler, java-sdk, java2-compiler, java2-sdk, java5-sdk,
    > java6-sdk
    > Depends: sun-java6-bin (>= 6.22-1), libc6, libx11-6
    > Pre-Depends: debconf (>= 0.5) | debconf-2.0
    > Suggests: sun-java6-demo, openjdk-6-doc, sun-java6-source
    > Description: Sun Java(TM) Development Kit (JDK) 6
    > The JDK(TM) is a development environment for building applications,
    > applets, and components using the Java programming language.
    > .
    > The JDK includes tools useful for developing and testing programs
    > written in the Java programming language and running on the Java
    > Platform.
    > .
    > NOTE: You must accept Sun's EULA prior to successfully installing
    > this package
    > Homepage: https://jdk-distros.dev.java.net
    >
    > ldo@theon:java_try> cat test.java
    > class test
    > {
    > public static void main(String[] args)
    > {
    > System.out.print("Got...");
    > double c = 2.2250738585072011e-308;
    > System.out.println(" here.");
    > } /*main*/
    > }
    >
    > ldo@theon:java_try> javac test.java
    > ldo@theon:java_try> java test
    > Got... here.
    >


    The number should be 2.2250738585072012e-308
    The number you have used is the one which affects PHP.

    Precision in computing is important.

    If your Java version is hit by the bug your code will hang the compiler.
    If you want to compile the class and test the bytecode on different JVM
    then use Double.parseDouble to parse a string constant. So far all these
    versions I've tried are affected by this bug:

    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
    Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
    Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
    Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
    OpenJDK Client VM (build 14.0-b16, mixed mode) "1.6.0_17"
    OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) "1.6.0_18"

    --
    Nigel Wade
     
    Nigel Wade, Feb 8, 2011
    #3
  4. Lawrence D'Oliveiro

    Paul Cager Guest

    On Feb 8, 2:21 pm, Nigel Wade <> wrote:

    > The number should be 2.2250738585072012e-308
    > The number you have used is the one which affects PHP.
    >
    > Precision in computing is important.
    >
    > If your Java version is hit by the bug your code will hang the compiler.
    > If you want to compile the class and test the bytecode on different JVM
    > then use Double.parseDouble to parse a string constant. So far all these
    > versions I've tried are affected by this bug:
    >
    > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
    > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
    > Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
    > Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
    > Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
    > OpenJDK Client VM (build 14.0-b16, mixed mode) "1.6.0_17"
    > OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) "1.6.0_18"


    GCJ isn't affected by the way:
    sh-3.2$ gcj --main=Test Test.java
    Test.java:6: warning: The local variable c is never read
    double c = 2.2250738585072012e-308;
    ^
    1 problem (1 warning)

    sh-3.2$ ./a.out
    Got... here.

    sh-3.2$ gcj --version
    gcj (Debian 4.3.2-2) 4.3.2
     
    Paul Cager, Feb 8, 2011
    #4
  5. Lawrence D'Oliveiro

    Lew Guest

    Nigel Wade wrote:
    > The number should be 2.2250738585072012e-308
    > The number you have used is the one which affects PHP.
    >
    > Precision in computing is important.
    >
    > If your Java version is hit by the bug your code will hang the compiler.
    >


    And thus NetBeans' IDE as it tries to internally compile the source.
    Oracle JDK.

    Evil!

    > If you want to compile the class and test the bytecode on different JVM
    > then use Double.parseDouble to parse a string constant. So far all these
    > versions I've tried are affected by this bug:
    >
    > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
    > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
    > Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
    > Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
    > Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
    > OpenJDK Client VM (build 14.0-b16, mixed mode) "1.6.0_17"
    > OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) "1.6.0_18"
    >


    $ java -version
    java version "1.6.0_23"
    Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
    Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)

    --
    Lew
     
    Lew, Feb 8, 2011
    #5
  6. Lawrence D'Oliveiro

    Tom Anderson Guest

    On Tue, 8 Feb 2011, Lew wrote:

    > Nigel Wade wrote:
    >> The number should be 2.2250738585072012e-308
    >> The number you have used is the one which affects PHP.
    >>
    >> Precision in computing is important.
    >>
    >> If your Java version is hit by the bug your code will hang the compiler.

    >
    > And thus NetBeans' IDE as it tries to internally compile the source.
    > Oracle JDK.
    >
    > Evil!


    I tried this in Eclipse earlier. I left work immediately after, and i'm
    hoping it'll have magically fixed itself when i get in tomorrow!

    tom

    --
    Oh, well of course *everything* looks bad if you remember it
     
    Tom Anderson, Feb 8, 2011
    #6
  7. In message <>, Nigel Wade wrote:

    > The number should be 2.2250738585072012e-308


    Yup, that’s it, javac is now stuck in a loop. :)
     
    Lawrence D'Oliveiro, Feb 8, 2011
    #7
    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. Razor
    Replies:
    2
    Views:
    974
    Razor
    Aug 19, 2003
  2. Brian McGonigle
    Replies:
    1
    Views:
    561
    Andrew Kavanaugh
    Aug 20, 2004
  3. F. GEIGER
    Replies:
    3
    Views:
    795
    F. GEIGER
    Aug 6, 2004
  4. Alexander Burger

    getMethod() works and works not

    Alexander Burger, Nov 27, 2010, in forum: Java
    Replies:
    25
    Views:
    1,803
    Alexander Burger
    Nov 29, 2010
  5. abargaddon
    Replies:
    1
    Views:
    207
    clintmazur
    Feb 4, 2008
Loading...

Share This Page