• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javac.exe - application error..!

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, everybody!
I'm doing some exercises for my Java students, and suddenly I had created the ugly excuse for code below. Now, if I change the figures in the Math.floor() call from 3.4 to -3.4 and back a couple of times, my compiler bugs out. Why???
public class Q extends Thread {
public static void main(String[] args) {
b((int) Math.floor(-3.4));
}
public static void b(int i) {
try {
}
catch (Exception e) { c(i); }
}
public static void c(int i) { if (i == -4) d(); }
public static void d() { System.out.println("Grufs!"); }
}
If I remove the extends Thread clause (which is completely useless, anyway) it works, I think. Anyone?
//Kaspar
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using Java 1.3.1 on the Windows NT platform, and this code compiles and runs with no problems many times, no matter what I send to the Math.floor() method...

Perhaps you should try running this on another computer and see if the problem occurs again... I don't see why this would happen... maybe your java compiler is corrupted?

-Nate
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too agree there is something wrong with the compiler, as i have tested ur sample on JBuilder 4.0 and any values to Math.floor it works
 
Kaspar Dahlqvist
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use jdk1.3.1 as well, but on Windows 2000. I get this error about every fifth time I compile this program, when I continuosly negate the double value in Math.floor(??). I'm very curious about why this happens. Is there a simple explanation that I have not seen, or... But you say that it works for you. Hmm... Can it be the jdk1.3.1 combined with the tremendously powerful Windows 2000?
..?
/Kaspar
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too tried it with Java 1.3 but on Win98 OS and compiles fine both ways.
Percy
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java 1.3.0_01
Win 2000
Everythig is Ok here....
Regards
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
I compiled the code 15 times: everything ok with jdk1.3.1 on W2000.
Bye
 
Kaspar Dahlqvist
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm... I'd better replace my compiler... :-)
Thanks, all!
 
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK here as well.
Win2k
jdk 1.3.0_03
Jason
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic