我在编译一个文件是出现了错误,错误内容如下.(原样复制过来的)
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_FLT_DIVIDE_BY_ZERO (0xc000008e) at pc=0x00f6a883, pid=496, tid=1168#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_10-b03 mixed mode)
# Problematic frame:
# j com.sun.tools.javac.v8.comp.Items$ImmediateItem.isPosZero(D)Z+0
#
# An error report file with more information is saved as hs_err_pid496.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_FLT_DIVIDE_BY_ZERO (0xc000008e) at pc=0x00f6a883, pid=496, tid=1168#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_10-b03 mixed mode)
# Problematic frame:
# j com.sun.tools.javac.v8.comp.Items$ImmediateItem.isPosZero(D)Z+0
#
# An error report file with more information is saved as hs_err_pid496.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
classpath删去不用的JDK路径试试。
class Months{
public static void main(String args[]){
double sum=0.0;
String str[] ={"January" , "February", "March" , "April",
"May" , "June" , "July" , "August",
"September","October" , "November", "December"};
double x[] = new double[12];
for(int i=0;i<12;i++){
x[i]=Math.random()*100;
sum += x[i];
}
for(int j=0;j<12;j++)
System.out.println("这个月为"+str[j]+"\n "+"这个月的数值为"+x[j]);
System.out.println("12个月的平均为"+sum/12);
}
}
x[i]=Math.random()*100;
sum += x[i];
}
for(int j=0;j<12;j++)
System.out.println("这个月为"+str[j]+"\n "+"这个月的数值为"+x[j]);
System.out.println("12个月的平均为"+sum/12);这样写不对
public static void main(String args[]){
double sum=0.0;
String str[] ={"January" , "February", "March", "April", "May" , "June", "July" , "August", "September","October" , "November", "December"};
double x[] = new double[12];
for(int i=0;i<12;i++){
x[i]=Math.random()*100;
sum += x[i];
System.out.println(sum);
}
}
}
应该是jdk的问题
重新安装试试