File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes programs dont run Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "programs dont run" Watch "programs dont run" New topic

programs dont run

Mark Robertson

Joined: Jan 10, 2006
Posts: 11
Hi everyone really hope someone can help me. I cannot run any programs in JBuilder. Due to:
java.lang.NoClassDefFoundError: arrayList

Exception in thread "main"

I have saved my short test program in C:\java\MyClasses and set the CLASSPATH to this from command Prompt to make sure the java file can be found but still receive this error. Any ideas how I can remedy this?
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Have you compiled your program with javac before trying to run it?

[Jess in Action][AskingGoodQuestions]
Mark Robertson

Joined: Jan 10, 2006
Posts: 11
hi sorry, got cut off for a while. Should I need to compile? I am just trying to run the most basic program.
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
You always need to compile a .java before it can run, regardless of size of the program. Java is not a normal interpreted language. It runs bytecode, and javac is needed to turn your .java files into .class files, which are interpreted by the JVM.

"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
marc weber

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Mark Robertson:
... Should I need to compile? I am just trying to run the most basic program.

Indeed, a .java file is just text. It must be compiled into a .class file before it can run.

See this Hello World tutorial for a walk-through of the basic steps in compiling and running.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Daniel Lucas
Ranch Hand

Joined: Apr 24, 2006
Posts: 48
After you've compiled your program, it should execute from then on. Java is different than some other languages, such as Visual Basic which lets you run your program anytime to see how it looks.
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
Does your program import java.util.ArrayList?

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: programs dont run
It's not a secret anymore!