• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

programs dont run

 
Mark Robertson
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you compiled your program with javac before trying to run it?
 
Mark Robertson
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 490
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Daniel Lucas
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your program import java.util.ArrayList?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic