Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2003
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 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

  • #2
    Regular Coder
    Join Date
    Dec 2003
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i guess what im trying to say is how do a set a classpath?

  • #3
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder
    Join Date
    Dec 2003
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, thanks


    ive got it working and am now writing java programs!

    again thankyou!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •