我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。2 }* T7 _6 S/ F* c: `
import swarm.Globals;
- G* l A2 O- b' |, f
9 _* c6 H8 s$ Z# A- S' ]) ?7 M( Ipublic class test {: y4 _7 v7 m- V# I9 H/ V4 W
/**
' z1 g; i6 O; g * @param args) I) ]; E/ s8 c& n' C9 L m
*/% o$ [% a9 R. t8 w5 B& v: k1 \* T& K
public static void main(String[] args) {3 }& F A& t! f1 g! R4 o
: V3 Z, J9 ]9 L% u2 {, J3 G4 O int y=(int)(10*Math.random());
- J" Q0 M+ C! ? System.out.println("result is "+y);3 D1 z6 M' ~. f m v
2 G: S2 H3 ^& g
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
$ }; q6 } K- I, P8 m$ |4 u System.out.print(z+" re");+ @! u1 O) D. C& Z% }; ]! o
}
" o0 ]* [1 I; S+ ~7 S}
3 A" m' b+ w3 i2 d' {) x: e, j- ]1 `+ s p2 [& F
结果是:
& D9 ^, L7 C% Q% ]. v1 |result is 2+ z1 R* k$ W9 ` Q {
#5 y" z3 f9 e4 U+ T9 d' l7 x! d
# An unexpected error has been detected by Java Runtime Environment:
6 r9 V4 M1 e8 N% k#
x1 W) s, Z+ P& b8 U# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=10681 e4 Y3 X# D' Z8 `" w# C
#
5 k1 i" M% v% Y I# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)' y* e9 E6 R \+ `1 `
# Problematic frame:
) O( x7 Z( L4 c" v1 G1 s+ j# C [javaswarm.dll+0xb8305]. V/ M4 D8 t, ?5 @, f2 z H' V
#; G* I1 N+ T. Z% y' S# J4 ?( P
# An error report file with more information is saved as hs_err_pid1064.log |