我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。' ~$ Y$ k1 t( y3 p j% H, d0 G$ A
import swarm.Globals;% r6 D* F; a X7 H4 }( U" B0 P
* \3 n; |+ Q2 |2 \$ W( v, D0 J0 K- Kpublic class test {
6 P6 n1 M# C8 r+ Y /**( j" C" Z! ^& Y; M$ @: ?2 n
* @param args
/ w& z6 p b5 H& r K( N+ e */
! K# {; g+ D$ \4 v! f( T! G1 J% F public static void main(String[] args) {
5 |9 z0 F, ~2 Y4 x' Q( a
& d6 z4 z- b3 V1 S int y=(int)(10*Math.random());
# r; N) m% G8 V System.out.println("result is "+y);
; L8 \6 u7 U8 }, r$ L* [( ?# P7 V( x) `/ @$ I7 a- Y+ X t
double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);, D0 E; f7 @/ a8 w$ f7 V! T+ c
System.out.print(z+" re");) R$ }: p8 ^( M2 m, d
}" k) A) U4 o) A. y; ]$ z! s
}3 I3 l4 c4 f6 C
" I1 y7 j$ }. L9 A2 g: L
结果是:* m Z( K; K* y6 w( c' x9 Z8 c
result is 2
2 x+ f& G% [7 W' O#
" ^, W' S, C' [9 j# An unexpected error has been detected by Java Runtime Environment:
, g/ v5 p, x0 e) X; W) C6 M#
# e5 R4 d' _- L- N5 x9 }# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
9 P$ Y2 [2 Z2 s1 y# t4 u6 {#9 `5 r- C( e I* t$ t& m1 ]
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)+ z4 L1 [' T# \3 U
# Problematic frame:6 Y# B3 k" K3 ]# G. |
# C [javaswarm.dll+0xb8305]
9 `1 D4 I7 y3 M4 A: M#; Q7 \/ U+ E, w' c7 X
# An error report file with more information is saved as hs_err_pid1064.log |