我在试着编程,很简单的取随机数,可就这样也不对,我不知道哪里错了,编译时没问题,而且在Eclipse环境下运行JSimpleBug的例程也没出错,可为什么我这个简单的试验程序却出错了呢?帮帮忙吧。在Eclipse环境下。
% h; ], U3 h3 q( y4 F; Ximport swarm.Globals;0 ]/ ~) M( g/ I4 i% N& j# ^" @
2 `5 w+ Y$ Q6 a5 e
public class test {
2 @7 |( \ R( e+ j% d) F /**% \: Q/ f. E: L. Y% ?, ?/ Q. K
* @param args1 j5 T* ^0 e& u0 v! j, f% b
*/8 n1 l, d' S) w: G+ M) }, ?5 `+ X
public static void main(String[] args) {
0 C% J# S' t* x6 E+ K! i; V* L5 |; m
% s0 k! f. V, l( M! D+ W- [5 q! ~ int y=(int)(10*Math.random());
, q$ B1 g8 x' P* ] System.out.println("result is "+y);
+ O+ ^5 F9 [/ C7 q
; H6 t% Y; s* `7 J _! s% w# \ double z=Globals.env.uniformDblRand.getDoubleWithMin$withMax(0.0, 1.0);
* B, d! s# b6 I& z' B9 ]; ^0 L8 d System.out.print(z+" re");+ G' a: W/ {% p$ m
}, }" e! ?5 F5 I8 a* u5 a O# @
}
- [1 {( V) a7 ~5 ~3 n {3 Y) g$ s9 s! Q6 j, F4 g% T
结果是:
- W1 ]: v" W+ f2 \# zresult is 2' h$ R% x$ b* v7 p8 e$ _3 I& t5 S
#
" J; z. b% g7 {! z# An unexpected error has been detected by Java Runtime Environment:
" r( n: ?4 X, [9 `* r7 l. U6 o' H/ i#4 y' `2 {# M" ]. E
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100b8305, pid=1064, tid=1068
( g4 a2 \" `" z% A9 V#
i8 d; A, X& w, A* O, n# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)2 {: E5 x% N: J8 `
# Problematic frame:
, w& S1 K+ i: F# C [javaswarm.dll+0xb8305]+ T0 f& L% c8 o, {" H+ P2 ?. w
#
^8 K/ v8 z/ k4 Z- H# An error report file with more information is saved as hs_err_pid1064.log |