Web Analytics Made Easy -
StatCounter compiling and running - CodingForum

Announcement

Collapse
No announcement yet.

compiling and running

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • compiling and running

    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

    10-4
    UNDER CONSTRUCTION

  • #2
    i guess what im trying to say is how do a set a classpath?
    UNDER CONSTRUCTION

    Comment


    • #3
      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.

      shmoove

      Comment


      • #4
        ok, thanks


        ive got it working and am now writing java programs!

        again thankyou!
        UNDER CONSTRUCTION

        Comment

        Working...
        X