Discussion:
Running Nachos in Eclipse
(too old to reply)
Min Xu
2007-09-15 08:11:56 UTC
Permalink
Hi, did anyone actually successfully run Nachos in Eclipse yet? I
followed the following steps and keep getting the error:
"java.lang.NoClassDefFoundError: nachos/machine/Machine
Exception in thread "main" "

I have Eclipse 3.2 with the latest version of Subclipse.
1. I checked out the entire nachos folder from
"https://isvn.eecs.berkeley.edu/cs162/group24/trunk" and configured it
as a new Java project ("CS162") in my Eclipse workspace.
2. I configured Run Dialog to run "CS162" project and use
"nachos.machine.Machine" as main. I also changed working directory to be
".../nachos/proj1" as opposed to just the default nachos.
3. I click run, hoping for the best
4. My hope is shattered by the NoClassDefFoundError

Can anyone provide some help?
Thanks a lot
Thomas Kho
2007-09-15 15:44:51 UTC
Permalink
Post by Min Xu
Hi, did anyone actually successfully run Nachos in Eclipse yet? I
"java.lang.NoClassDefFoundError: nachos/machine/Machine
Exception in thread "main" "
I have Eclipse 3.2 with the latest version of Subclipse.
1. I checked out the entire nachos folder from
"https://isvn.eecs.berkeley.edu/cs162/group24/trunk" and configured it
as a new Java project ("CS162") in my Eclipse workspace.
2. I configured Run Dialog to run "CS162" project and use
"nachos.machine.Machine" as main. I also changed working directory to
be ".../nachos/proj1" as opposed to just the default nachos.
3. I click run, hoping for the best
4. My hope is shattered by the NoClassDefFoundError
http://inst.eecs.berkeley.edu/~cs162/fa07/Nachos/eclipse/

See if that helps you out, especially the "Running Nachos" section.

-Tom
Min Xu
2007-09-16 03:37:46 UTC
Permalink
I fixed the problem. Eclipse requires that we put all the source files
in the src folder which I didn't do.
Post by Thomas Kho
Post by Min Xu
Hi, did anyone actually successfully run Nachos in Eclipse yet? I
"java.lang.NoClassDefFoundError: nachos/machine/Machine
Exception in thread "main" "
I have Eclipse 3.2 with the latest version of Subclipse.
1. I checked out the entire nachos folder from
"https://isvn.eecs.berkeley.edu/cs162/group24/trunk" and configured it
as a new Java project ("CS162") in my Eclipse workspace.
2. I configured Run Dialog to run "CS162" project and use
"nachos.machine.Machine" as main. I also changed working directory to
be ".../nachos/proj1" as opposed to just the default nachos.
3. I click run, hoping for the best
4. My hope is shattered by the NoClassDefFoundError
http://inst.eecs.berkeley.edu/~cs162/fa07/Nachos/eclipse/
See if that helps you out, especially the "Running Nachos" section.
-Tom
Max Preston
2007-09-28 07:51:00 UTC
Permalink
Is this really the only way to make it so that Eclipse can find main in
nachos.machine.Machine? Because I tried moving everything to my src folder
and now I can't commit anything with SVN, probably since my file structure
is totally different now.

Is there any way to get this to work without messing up my file structure??
It seems like there REALLY should be a way! But if you just follow the
"Running Nachos" instructions at
http://inst.eecs.berkeley.edu/~cs162/fa07/Nachos/eclipse/, Eclipse just
can't find main anywhere...

Please help! Thanks!
I fixed the problem. Eclipse requires that we put all the source files in
the src folder which I didn't do.
Post by Thomas Kho
Post by Min Xu
Hi, did anyone actually successfully run Nachos in Eclipse yet? I
"java.lang.NoClassDefFoundError: nachos/machine/Machine
Exception in thread "main" "
I have Eclipse 3.2 with the latest version of Subclipse.
1. I checked out the entire nachos folder from
"https://isvn.eecs.berkeley.edu/cs162/group24/trunk" and configured it
as a new Java project ("CS162") in my Eclipse workspace.
2. I configured Run Dialog to run "CS162" project and use
"nachos.machine.Machine" as main. I also changed working directory to be
".../nachos/proj1" as opposed to just the default nachos.
3. I click run, hoping for the best
4. My hope is shattered by the NoClassDefFoundError
http://inst.eecs.berkeley.edu/~cs162/fa07/Nachos/eclipse/
See if that helps you out, especially the "Running Nachos" section.
-Tom
Max Preston
2007-09-28 09:47:40 UTC
Permalink
No, I have the problem that Min originally had.

I'm trying to run the OS nachos, itself. (with eclipse, running on windows
xp)
It can't find main in nachos.machine.Machine

Specifically, when I try to run Nachos, I get the following error popup:
"Could not find the main class. Program will exit."

The error message on the console reads:
"java.lang.NoClassDefFoundError: nachos/machine/Machine"



Moving everything to the src folder kind of messes up my file system, but
nachos does run and provides the lines of output that it is supposed to
after a successful run.

HOWEVER, doing this makes it so that I can't commit to SVN, most likely
since my file system is weird (I don't normally put all my files in the src
folder). And since not everyone in my group uses Eclipse, as well as since I
want it to compile correctly after we submit it, it would be *very bad* for
me to just use this setup. I want to instead find a way so that I can
compile and run nachos with the default setup or at least set it up
correctly so that I can use SVN without having to worry about any
differences in the file system.

Anyway, here is a screenshot of what part of my setup looks like:

Loading Image...

Can anyone please tell me what I am doing wrong and how to fix it? Thanks.
---------------
are you trying to make a test class to test something and trying to run
that
Could not find the main class. Program will exit.
java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException
at nachos.threads.Lock.<init>(Lock.java:78)
at nachos.threads.Communicator.<init>(Communicator.java:25)
at nachos.threads.communicatorTest.<clinit>(communicatorTest.java:4)
Exception in thread "main"
something like that?
if yes, then you need to go look at the ThreadedKernel class in the
selfTest
method. it's where you should be putting in methods that you want to
test.
-------------
Post by Max Preston
Is this really the only way to make it so that Eclipse can find main in
nachos.machine.Machine? Because I tried moving everything to my src folder
and now I can't commit anything with SVN, probably since my file structure
is totally different now.
Is there any way to get this to work without messing up my file structure??
It seems like there REALLY should be a way! But if you just follow the
"Running Nachos" instructions at
http://inst.eecs.berkeley.edu/~cs162/fa07/Nachos/eclipse/, Eclipse just
can't find main anywhere...
Please help! Thanks!
I fixed the problem. Eclipse requires that we put all the source files in
the src folder which I didn't do.
Post by Thomas Kho
Post by Min Xu
Hi, did anyone actually successfully run Nachos in Eclipse yet? I
"java.lang.NoClassDefFoundError: nachos/machine/Machine
Exception in thread "main" "
I have Eclipse 3.2 with the latest version of Subclipse.
1. I checked out the entire nachos folder from
"https://isvn.eecs.berkeley.edu/cs162/group24/trunk" and configured it
as a new Java project ("CS162") in my Eclipse workspace.
2. I configured Run Dialog to run "CS162" project and use
"nachos.machine.Machine" as main. I also changed working directory to be
".../nachos/proj1" as opposed to just the default nachos.
3. I click run, hoping for the best
4. My hope is shattered by the NoClassDefFoundError
http://inst.eecs.berkeley.edu/~cs162/fa07/Nachos/eclipse/
See if that helps you out, especially the "Running Nachos" section.
-Tom
Thomas Kho
2007-09-28 13:49:06 UTC
Permalink
Post by Max Preston
No, I have the problem that Min originally had.
I'm trying to run the OS nachos, itself. (with eclipse, running on windows
xp)
It can't find main in nachos.machine.Machine
"Could not find the main class. Program will exit."
"java.lang.NoClassDefFoundError: nachos/machine/Machine"
Moving everything to the src folder kind of messes up my file system, but
nachos does run and provides the lines of output that it is supposed to
after a successful run.
HOWEVER, doing this makes it so that I can't commit to SVN, most likely
since my file system is weird (I don't normally put all my files in the src
folder). And since not everyone in my group uses Eclipse, as well as since I
want it to compile correctly after we submit it, it would be *very bad* for
me to just use this setup. I want to instead find a way so that I can
compile and run nachos with the default setup or at least set it up
correctly so that I can use SVN without having to worry about any
differences in the file system.
http://img233.imageshack.us/img233/6601/nomainuq1.jpg
Can anyone please tell me what I am doing wrong and how to fix it? Thanks.
When you create a project, you have the project layout option to "Use
project folder as root for sources and class files" which is the
*desirable* option. Can you try creating the project again with that
option?

-Tom
Jay Lundy
2007-09-28 22:13:02 UTC
Permalink
Post by Max Preston
http://img233.imageshack.us/img233/6601/nomainuq1.jpg
According to the screenshot you checked out "trunk/nachos" from SVN. You
need to checkout "trunk". The top-level folder of your eclipse workspace
should have a folder called "nachos" and nothing else (if you look at it
in the filesystem).
Dan
2007-09-30 05:03:22 UTC
Permalink
Hi all,

I'm having trouble getting Nachos to run in Eclipse as well.

I checked out Nachos from the repository successfully, but many of the
variable names have the error 'xxx cannot be resolved' or, in the case
of Machine.java, Lib.checkDerivation has the helpful eclipse warning of:
"The method checkDerivation(Class, Class) is undefined for the type Lib"

Any helpful hint as to what's wrong? I could provide more examples of
the zillions of things like this. I think my system is correctly set up
and my filesystem is too.

Thanks,
Daniel
Dan
2007-09-30 05:06:36 UTC
Permalink
Hi all,

I'm having trouble getting Nachos to run in Eclipse as well.

I checked out Nachos from the repository successfully, but many of the
variable names have the error 'xxx cannot be resolved' or, in the case
of Machine.java, Lib.checkDerivation has the helpful eclipse warning of:
"The method checkDerivation(Class, Class) is undefined for the type Lib"

Any helpful hint as to what's wrong? I could provide more examples of
the zillions of things like this. I think my system is correctly set up
and my
Max Preston
2007-09-30 06:42:40 UTC
Permalink
Alright, I FINALLY got the problem fixed.

First set it up so that all the nachos folders are packages with all the
java files having errors in them because the top "package nachos.whatever"
line doesn't work.

Then go to windows explorer or whatever you use to manage your OS's file
system and find your cs162 workspace.

It should look something like Eclipse Workspace / nachos / a lot of folders

Make a new folder in your Eclipse Workspace directory and put the nachos
folder in it. Then rename the new folder to nachos.

Now your file structure should look something like Eclipse Workspace /
nachos / nachos / a lot of folders

and now, it should work... somehow!!

WHY you have to mess with the file structure in such a bizzare way, I have
NO IDEA! Whoever is in charge of the documentation for setting nachos up,
please make sure that following the exact directions in the documentation
results in nachos working correctly!
Post by Dan
Hi all,
I'm having trouble getting Nachos to run in Eclipse as well.
I checked out Nachos from the repository successfully, but many of the
variable names have the error 'xxx cannot be resolved' or, in the case
"The method checkDerivation(Class, Class) is undefined for the type Lib"
Any helpful hint as to what's wrong? I could provide more examples of
the zillions of things like this. I think my system is correctly set up
and my
Max Preston
2007-10-01 23:36:52 UTC
Permalink
Actually, it stopped working again after 24 hours.

Check out the trunk folder instead of the nachos folder using the setting in
the new project wizard that turns all the folders into packages.

For some reason, that worked for me on my first try.
Post by Max Preston
Alright, I FINALLY got the problem fixed.
First set it up so that all the nachos folders are packages with all the
java files having errors in them because the top "package nachos.whatever"
line doesn't work.
Then go to windows explorer or whatever you use to manage your OS's file
system and find your cs162 workspace.
It should look something like Eclipse Workspace / nachos / a lot of folders
Make a new folder in your Eclipse Workspace directory and put the nachos
folder in it. Then rename the new folder to nachos.
Now your file structure should look something like Eclipse Workspace /
nachos / nachos / a lot of folders
and now, it should work... somehow!!
WHY you have to mess with the file structure in such a bizzare way, I have
NO IDEA! Whoever is in charge of the documentation for setting nachos up,
please make sure that following the exact directions in the documentation
results in nachos working correctly!
Post by Dan
Hi all,
I'm having trouble getting Nachos to run in Eclipse as well.
I checked out Nachos from the repository successfully, but many of the
variable names have the error 'xxx cannot be resolved' or, in the case
"The method checkDerivation(Class, Class) is undefined for the type Lib"
Any helpful hint as to what's wrong? I could provide more examples of
the zillions of things like this. I think my system is correctly set up
and my
Continue reading on narkive:
Loading...