Java 堆栈上的 Eclipse 过时方法

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21447002/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 08:46:35  来源:igfitidea点击:

Eclipse obsolete methods on the stack

javaeclipsemacos

提问by vap

I'm using Eclipse for Java on my Macbook air, OS 10.9. I keep getting the error Obsolete Methods on the Stack, with a warning about how it may cause problems with the virtual machine when I run very basic programs that have no errors. I ran a program that just had the class and the main method and I got this error. After the error box, the bug referred to the main method, but I know the syntax is correct because I used Eclipse's main method.

我在 Macbook air 操作系统 10.9 上使用 Eclipse for Java。我不断收到错误消息Obsolete Methods on the Stack,并警告当我运行没有错误的非常基本的程序时,它可能如何导致虚拟机出现问题。我运行了一个只有类和 main 方法的程序,但出现了这个错误。错误框后,bug 指的是 main 方法,但我知道语法是正确的,因为我使用了 Eclipse 的 main 方法。

import java.util.Scanner;

public class Dowhile {

    public static void main(String[] args) {
        /*Scanner scanner = new Scanner(System.in);
        System.out.println("Enter a number");
        int value = scanner.nextInt();
        System.out.println(value);*/
        /*do{
            System.out.println("Enter a number ");
            int value = scanner.nextInt();

        }
        while(value != 5);
        System.out.println("Got 5");*/
    }
}

Update:

更新:

I'm not getting the obsolete methods error now, just Exception in thread "main"... at line 5.

我现在没有收到过时的方法错误,只是Exception in thread "main"... at line 5.

回答by Blasanka

This error message indicates that you are doing hot code replace, and that the frames on the stack no longer match the class files in the running VM. Restarting your debug session/target VM should suffice.

此错误消息表明您正在执行热代码替换,并且堆栈中的帧不再与正在运行的 VM 中的类文件匹配。重新启动调试会话/目标 VM 就足够了。

Hot code replace (HCR) meaning:

热代码替换 (HCR) 含义:

It is a debugging technique whereby the Eclipse Java debugger transmits new class files over the debugging channel to another JVM.

它是一种调试技术,Eclipse Java 调试器通过该技术将新类文件通过调试通道传输到另一个 JVM。

read more.

阅读更多

Bugzilla

布吉拉

Dreamincode

梦想密码