ClassNotFoundException [message #708441] |
Tue, 02 August 2011 20:19 |
kthomp271828 Messages: 2 Registered: August 2011 |
Junior Member |
|
|
I have been using Eclipse Galileo for some time. Recently, I installed Europa for Java IDE. I wrote a basic program that imported nothing other than some classes from java.io and java.util. When I tried to run the program, I got a ClassNotFoundException error. It is my understanding that this error occurs when a class needed by the compiler is not on the class path. The problem is that I don't understand what isn't specified on the class path (what I need to add) or where those files are located. The Europa stack trace error is below:
Thread [main] (Suspended)
ClassNotFoundException(Throwable).<init>(String, Throwable) line: 286
ClassNotFoundException(Exception).<init>(String, Throwable) line: not available
ClassNotFoundException(ReflectiveOperationException).<init>(String, Throwable) line: not available
ClassNotFoundException.<init>(String) line: not available
URLClassLoader$1.run() line: not available
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: not available
Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
driver.main(String[]) line: 12
C:\Program Files\Java\jre7\bin\javaw.exe (Aug 1, 2011 2:23:51 AM)
|
|
|
Re: ClassNotFoundException [message #708455 is a reply to message #708441] |
Tue, 02 August 2011 20:26 |
|
On 02-Aug-11 14:19, kthomp271828 wrote:
> I have been using Eclipse Galileo for some time. Recently, I installed
> Europa for Java IDE. I wrote a basic program that imported nothing other
> than some classes from java.io and java.util. When I tried to run the
> program, I got a ClassNotFoundException error. It is my understanding
> that this error occurs when a class needed by the compiler is not on the
> class path. The problem is that I don't understand what isn't specified
> on the class path (what I need to add) or where those files are located.
> The Europa stack trace error is below:
[snip]
(And you backed up by 2 full releases from Galileo because...? The
present current release is the second since Galileo.)
Include the source code to what appears to be driver.main(). There may
be a clue in there.
|
|
|
|
Re: ClassNotFoundException [message #708472 is a reply to message #708463] |
Tue, 02 August 2011 21:06 |
|
On 02-Aug-11 14:48, kthomp271828 wrote:
> Oh, maybe it wasn't Galileo (or maybe I was confused when I downloaded
> Europa). I had to re-install everything recently and went to
> eclipse.org/downloads to get the Java IDE. For some reason, it took me
> to Europa as the default download so I assumed it was more recent. I see
> now that isn't the case.
> [snip]
If recent, your download should be Indigo then. That's great.
Okay, a couple of observations...
First, 16 year-old Java practice holds that your class name begin with
an upper-case letter. (This is not your exception.)
Second, you should always subsume your Java class down under a formally
named package. Maybe something like: edu.myschool.cs.exercises (can be
anything you like--this is also not your present exception).
Third, I don't see an import statement defining class NeuralNetwork.
This might be your exception. I'm not certain how the compiler let you
get away with this in the first place or why Eclipse accepted to let you
run it.
Observations 1 and 2 are Java questions that should be answered in your
class, in your book, or in specifically Java forums (like the really
great Java Ranch forums). Observation 3 is probably also a Java
question, but would naturally be asked in this forum as you're running
it in Eclipse and it's unclear why it's crashing.
Someone stronger in Java than I might look at your stack trace and
intuit a better response than I'm giving you. Obviously, it's easier to
diagnose having it in one's own workbench.
Last, did you download and set up a proper JDK in installed JREs? If
it's not clear to you what this is, check out the first half of
http://www.javahotchocolate.com/tutorials/setup-jdk.html. This would
tend to make some of the stack trace clearer in some instances.
|
|
|
Powered by
FUDForum. Page generated in 0.08055 seconds