NoClassDefFoundError.....your kidding me.
Yeaaa I know there are threads all over the place about this and I'v read them all and it wont work!!! So maybe it's somthing spicific that someone here can help me with. Heres the deal the class im trying to run is in:
C:\Documents and Settings\Family\Desktop\exampleprog\videostore\controller
and it is called Bootstrap.class
I get that NoClassDefFoundError
I go like this,set CLASSPATH=C:\Documents and Settings\Family\Desktop\exampleprog
I still get the error. I dont know if it matters but the class package is
videostore.controllerso thats why I picked the exampleprog folder for CLASSPATH... anyways whats the deal why isn't it working?
[689 byte] By [
Kroogera] at [2007-11-26 21:23:41]

Confirm the classpath is being set right.I think in DOS it's "echo %CLASSPATH%". What does that give you?
Also how are you invoking java when you run this? Show us the command you're typing in.
When I use echo it prints back:C:\Documents and Settings\Family\Desktop\exampleprogTo run the program I type:C:\Documents and Settings\Family\Desktop\exampleprog\videostore\contoller\java Bootstrap
Are you sure you're getting a NoClassDefFoundError? Because given that command, you should be getting an error message from Windows complaining that it can't find java.exe.
Yea thats why I'm so confused, this is the exact message.Execption in thread "main" java.lang.NoClassDefFoundError: BootstrapIv done this on a linux system before and I was fine but nothing I try here is working
What's in C:\Documents and Settings\Family\Desktop\exampleprog\videostore\contoller\? Did you create a batch file called "java.bat" or something?
This is the contents of the folder:
bluej.pkg
bluej.pkh
Bootstrap.class
Bootstrap.ctxt
Bootstrap.java
calgary_small.gif
MapModel.class
MapModel.ctxt
MapModel.java
MapModelListener.class
MapModelListener.ctxt
MapModelListener.java
README.TXT
VideoStoreController.class
VideoStoreController.ctxt
VideoStoreController.java
VideoStoreMapModel.class
VideoStoreMapModel.ctxt
VideoStoreMapModel.java
All the weird files there are added by the editor that I use.
( .ctxt and bluej stuff )
What's the content inside Bootstrap.java ?
Make sure the following line inside the file
public class Bootstrap
And if you have used
package bah.bah;
Then you should use java bah.bah.Bootstrap instead of java Bootstrap
In case it's the matter of "package"make sure you run the "java" underC:\Documents and Settings\Family\Desktop\exampleprogwith the following commandjava videostore.controller.Bootstrap
Heh...java videostore.controller.Bootstrapworked :Pohhh man good call.It's weird I'v never had to do that before.Thank you both for the help very much.
But can anyone explain how he can invoke an executable that isn't there?
I don't understand what you mean
Krooger,
Just to make sure you know why but not just how in this time.
If the class is in a "package", you have to go to the outer folder and run the inner class.
If you got
package com.sun.forum;
public class MyClass
you have to run
java com.sun.forum.MyClass
paulcw,
I guess JAVA_HOME, PATH or other environment variables take care the "java". I am not sure.
You said that you invoked java like this:
C:\Documents and Settings\Family\Desktop\exampleprog\videostore\contoller\java Bootstrap
But there is no java.exe executable in the controller directory. You have an absolute path to something that doesn't exist. Windows should complain; nothing should be executed. And yet apparently it did.
The way I understand how that works is that the command java is global to the system I could have even ran
C:\java videostore/controller/Bootstrap
and it will still run. When I call the java command it looks at its path for CLASSPATH and it will find the file Bootstrap.class and it will run it with the default JVM.
Atleast it works along thoese lines
But the issue isn't the JVM at all. It's how Windows locates executables.Maybe that's the answer: "Windows is insane."
Dosen't it do it with registries?