Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Mar 2007 18:01:05 -0700 (PDT)
From:      Nick Johnson <freebsd@spatula.net>
To:        "victori@salesdepotinc.com" <victori@salesdepotinc.com>
Cc:        FreeBSD-gnats-submit@FreeBSD.org, freebsd-java@freebsd.org
Subject:   Re: java/110364
Message-ID:  <20070315173523.I97295@turing>
In-Reply-To: <635C86FC-5150-4528-972E-A5E99418D0A9@salesdepotinc.com>
References:  <635C86FC-5150-4528-972E-A5E99418D0A9@salesdepotinc.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I actually get a completely different reaction, not a ParseException:

/usr/ports/java/jdk15/work/control/build/bsd-i586/bin/java Test
Exception in thread "main" java.lang.NoClassDefFoundError: UnhappyClass
        at Test.main(Test.java:5)

To make matters weirder, if I call my file on FreeBSD Test.java, the same 
thing happens.

But if I call my file test.java (all lowercase), which produces a class 
called test.class it works.

If I call my test file FooBar.java, or TesT.java that is fine as well.  It 
looks like "Test" with no package name is a name you cannot use with 
diablo JDK.  That's a different bug entirely.

Incidentally, if I call the class "FooBar" and compile on Windows and run 
it on FreeBSD, that also works fine.  It prints $1.99, just as it should.  
The same is true for code compiled on Linux.  And Solaris.  I cannot 
reproduce this problem using the Diablo JDK built out of ports as of 
January 28, 2007.

   Nick


On Thu, 15 Mar 2007, victori@salesdepotinc.com wrote:

> Anonuser has posted on my behalf, seems like this issue with NumberFormat is
> at the bytecode level
> 
> Here is an example testcase:
> 
> import java.text.*;
> 
> public class Test {
>   public static void main(String[] args) {
>    try {
>    System.out.println(NumberFormat.getCurrencyInstance().parse("$1.99").doubleValue());
>    } catch (Exception e) {
>    e.printStackTrace();
>   }
>   }
> }
> 
> Save as Test.java ; compile under the SUN JVM:  javac Test.java
> 
> 
> Run the class under the Diablo jvm and you will receive
> 
> -bash-2.05b$ java Test
> java.text.ParseException: Unparseable number: "$1.99"
>        at java.text.NumberFormat.parse(NumberFormat.java:309)
>        at Test.main(Test.java:6)
> 
> And when I run it with the SUN JDK
> 
> absolute# /usr/local/linux-sun-jdk1.5.0/bin/java Test
> 1.99
> 
> 
> Works correctly.
> 
> 
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"
> 

-- 
"Humans are a dangerously insane and very sick species."
   -- Eckhart Tolle
This message has been brought to you by Nick Johnson 2.2 and the number 6.
http://healerNick.com/       http://morons.org/        http://spatula.net/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070315173523.I97295>