简体   繁体   English

为什么我的Java程序崩溃?

[英]Why does my java program crashes?

My program compiles and runs correctly but after the execution, my program crashes. 我的程序编译并正确运行,但是执行后,我的程序崩溃了。

替代文字

Below is my code: 下面是我的代码:

public class Hi 
{
    public static void main (String[]args) 
        {
        System.out.println("Hi");

        }
}

Can anyone help me regarding this... thanks. 有人可以帮我吗...谢谢。

It's not your program that crashed, it's javac , ie the compiler itself. 崩溃的不是您的程序,而是javac ,即编译器本身。 Something's terribly wrong with your Java installation (or your system itself) - try re-installing it. 您的Java安装(或系统本身)存在严重问题-尝试重新安装。

The command javac itself is failing means, its not even compiled... problem is definitely at JDK installation, you may have installed a wrong arch or for wrong platform. javac本身的命令失败,甚至无法编译...问题肯定在JDK安装上,您可能安装了错误的arch或错误的平台。 If it is right, try reinstalling it again and make sure your installation path has no spaces in it 如果正确,请尝试重新安装,并确保安装路径中没有空格

It compiles without any problem and runs fine. 它可以毫无问题地编译并且运行良好。 The thing is, that program is just fine and nothing should be going wrong. 事实是,该程序很好,没有任何问题。

I rarely used javac (prefer eclipse or netbeans for running C code. 我很少使用javac(更喜欢使用eclipse或netbeans运行C代码。

As they said, its doesn't seem to be your code, but Javac 正如他们所说,它似乎不是您的代码,而是Javac

if there was a problem with your file or code it would print a log. 如果您的文件或代码有问题,它将打印日志。

try reinstalling java jdk 尝试重新安装Java JDK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM