View Full Version : compiling and running

02-09-2004, 06:59 PM
hello everyone,

i have been doing javascript for a year and i wanted to start in to java. i learnt alot of java, but i couldnt compile the program. the book said stuff about a command line and jdk1.3.1... well just 10 seconds ago i figured out jdk1.3.1 is j2se1.3.1... so i whipped up a simple program that sais "hello", i compiled it and i tryed to run it like so on the command line(the class is called Example):

java Example

when i did that, it said something like noClassDefError or something like that... i dont know what the problem is, but does it have anything to do with a classpath?

forgive me if im not making any sense, but ive just got to get this working!

thank you very much


02-09-2004, 07:24 PM
i guess what im trying to say is how do a set a classpath?

02-10-2004, 09:53 AM
To set a classpath all you have to do is add a "-classpath [path of the classes]" parameter to your command line. The path should point at the directory that contains all your .class files.


02-10-2004, 07:36 PM
ok, thanks

ive got it working and am now writing java programs!

again thankyou!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum