1

I am getting the following error when running nachos in eclipse:

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)

The above two methods are as follows:

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); }
    });
    }
Jim Garrison
  • 85,615
  • 20
  • 155
  • 190
Ruchi
  • 11
  • 1
  • 1
    `Unresolved compilation problem` means there was a compilation error in the source code. You need to show the compilation error messages. – Jim Garrison Sep 03 '14 at 04:12
  • Did you mean `AssertionFailureError` or `AssertionFailedError` ? If the former - where and how is it defined ? – Nir Alfasi Sep 03 '14 at 04:42
  • Yes, AssertionFailureError is defined as follows: class AssertionFailureError extends Error { AssertionFailureError() { super(); } AssertionFailureError(String message) { super(message); } } /*On compiling I am getting the following error: The serializable class AssertionFailureError does not declare a static final serialVersionUID field of type long.*/ – Ruchi Sep 04 '14 at 05:28

1 Answers1

1

I had this same error come up for me when I was trying to run nachos through eclipse. What I did was to look at Lib.java and scroll down to the function with an eclipse error on it. For me it was checkDerivation. There should be an eclipse error on the parameters <?>, if you look at the auto fix eclipse gives you and pick the project wide fix nachos should run after that.

BhavikUp
  • 105
  • 1
  • 2