Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running .class from cmd

Status
Not open for further replies.

rolfarj

Programmer
Mar 25, 2006
1
NO
Hello. I am trying to run .java-files from cmd. First i type: "javac filename.java" to make it into a .class-file. This works fine, but when i try to run the .class file typing: "java filename" i get an error message:

Exeption in thread "main" java.lang.NoClassDefFoundError: filename

Do you know what I am doing wrong. Maybe i have need to configure java in some way?
 
This is a classpath problem:
try using
java -cp . filetitle
alternatively set your classpath at command line thus:
set classpath=.
then you can use java filetitle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top