gpt4 book ai didi

java - NACHOS 线程 "main"中的 eclipse 异常

转载 作者:太空宇宙 更新时间:2023-11-04 14:35:32 24 4
gpt4 key购买 nike

在 eclipse 中运行 nachos 时出现以下错误:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 

at nachos.machine.Lib.assertTrue(Lib.java:75)
at nachos.machine.Machine.main(Machine.java:24)

以上两种方法如下:

nachos.machine.Lib.assertTrue:

public static void assertTrue(boolean expression) {
if (!expression)
throw new AssertionFailureError();
}

nachos.machine.Machine.main:

 public static void main(final String[] args) {
System.out.println("nachos 5.0j initializing...");
Lib.assertTrue(Machine.args == null);//This is the call after which error is thrown
Machine.args = args;

processArgs();

Config.load(configFileName);

// get the current directory (.)
baseDirectory = new File(new File("").getAbsolutePath());
// get the nachos directory (./nachos)
nachosDirectory = new File(baseDirectory, "nachos");

String testDirectoryName =
Config.getString("FileSystem.testDirectory");

// get the test directory
if (testDirectoryName != null) {
testDirectory = new File(testDirectoryName);
}
else {
// use ../test
testDirectory = new File(baseDirectory.getParentFile(), "test");
}

securityManager = new NachosSecurityManager(testDirectory);
privilege = securityManager.getPrivilege();

privilege.machine = new MachinePrivilege();

TCB.givePrivilege(privilege);
privilege.stats = stats;

securityManager.enable();
createDevices();
checkUserClasses();

autoGrader = (AutoGrader) Lib.constructObject(autoGraderClassName);

new TCB().start(new Runnable() {
public void run() { autoGrader.start(privilege); }
});
}

最佳答案

当我尝试通过 Eclipse 运行 Jade 米片时,我遇到了同样的错误。我所做的就是查看 Lib.java 并向下滚动到带有 eclipse 错误的函数。对我来说是checkDerivation 。参数 <?> 应该有 eclipse 错误,如果您查看 Eclipse 为您提供的自动修复,并选择项目范围内的修复 nachos 之后应运行的内容。

关于java - NACHOS 线程 "main"中的 eclipse 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25635946/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com