programming in java - need help

Started by scottmmmm, Sun 18/06/2006 15:27:41

Previous topic - Next topic

scottmmmm

I'm trying to learn to write programs in Java, and using a textbook i have written a program to calculate the factorial of a number. Using the DOS command window i managed to compile the program, but when i tried to run the program using the java command in DOS i get the error "noclassdeffound" I looked on the internet to try to figure out how to fix this problem and most solutions involve altering the "classpath". I have tried to do this but i cant get it to work. I dont know what to set the classpath to. If anyone could help me sort this problem out i would be very grateful.

Scott

MillsJROSS

Why exactly are you using the command line for this program anyway? Get an IDE like netbeans (it's free), as well as the actual Java libraries (if you haven't done so already), and try that out.

-MillsJROSS

scotch

I'm not sure what the problem is from that, perhaps you could post the actual commands you're using, and the full error messages produced.Ã,  That'd make helping easier.

I'd recommend getting an IDE too... especially when you code larger programs than one file. I used to use Netbeans, and I liked certain things about it, but it's so amazingly slow for me, and certain things about the newer versions bug me.Ã,  If you want a big, featureful IDE I'd recommend Eclipse (Which you can use for languages besides Java, but Java is the best supported), or for a simpler one, try JCreator LE.

Pedantically speaking, the Windows command prompt shouldn't be called a DOS window. It's a Windows program and so are most of the commands you use in it, so it's simply called the command prompt.

scottmmmm

thanks guys. I got netbeans and im gonna give it a try. I managed to get my programs to work, i just had to learn to use the command window, lol it involved changing the directory and other simple commands that i didnt know before. damned windows xp, im not used to the cool retro stuff :p

thank you

SMF spam blocked by CleanTalk