我开始在Netbeans中开展一个maven项目,几周后我的代码开始随机出错。原来IDE随机停止识别我一直在使用的特定类。这可能是一些超级基本的Java问题,可以通过适当的练习来解决,但我觉得我需要帮助。
错误类代码:
package me.mafrans.plm.httpd.pages;
import com.commodore.pixellibertymod.rank.Rank; // This is the import that is erroring
import java.io.IOException;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import me.mafrans.plm.httpd.util.PUtil;
public class index implements WebPage
{
@Override
public String[] getPages()
{
return new String[] {"index", "header", "header_style.css"};
}
@Override
public String getHTML(String url, Map<String,String> params, Rank userrank)
{
try
{
return PUtil.getHtmlFile("index");
}
catch (IOException ex)
{
Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex);
}
return "<html><body style=\"font-family:Arial\"><h1 style=\"text-align:center;\">404</h1>\n"
+ "<p style=\"text-align:center;\">This page could not be found, maybe it's down for the moment?</p>\n"
+ "</body></html>";
}
}
正如您在屏幕截图中看到的那样,Rank.class显然存在: screenshot
我尝试过: - 重新启动netbeans - 清除netbeans缓存 - 读取依赖项 - 使用着色依赖项 - 删除漫游/ Netbeans文件夹
此外,当允许netbeans自动完成类时,它只显示Displayable类:screenshot
答案 0 :(得分:0)
原来这是所有Netbeans的错误,因为当使用另一个像IntelliJ IDEA这样的IDE时,这个问题无处可见