简体   繁体   English

Eclipse Java是否在注释中发现“无法解决”错误?

[英]Eclipse Java is finding “cannot be resolved” errors in comments?

In the following code: 在下面的代码中:

public void connect()
{
/*      
    String selectedPort = "COM1";
    String selectedPort = (String)window.cboxPorts.getSelectedItem();
    selectedPortIdentifier = (CommPortIdentifier)portMap.get(selectedPort);
*/ 
}

Eclipse complains that selectedPort cannot be resolved. Eclipse抱怨selectedPort无法解析。 Why is it even looking inside of a comment? 为什么甚至在评论中查找内容?

First, you need to refresh the project. 首先,您需要刷新项目。

Second, clean and rebuild. 第二,清理和重建。 This must be happening as the new class file is not generated for you java file and eclipse is still looking at the previous compiled form. 这一定会发生,因为不会为您的Java文件生成新的类文件,而eclipse仍在查看以前的编译形式。

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

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