Results 1 to 3 of 3
  1. #1
    Joe2003 is offline Member
    Join Date
    Jan 2008
    Posts
    21
    Rep Power
    0

    Default java in cmd line :(

    Hey

    im trying to write some build scripts for a java project. Anyway, it HAS to be in MS which has lead me through the pain of batch scripts.

    Anyway, if I do this:-

    java Main

    the program runs fine, however if I move up a dirrectory level and execute the command like this:-

    java classes\Main

    it comes up with a java.lang.NoClassDefFoundError

    anyone know why, and how to sort it?

    thanks

    Joe

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    762
    Rep Power
    10

    Default

    It is about the Java classpath. Classpath is where the java program will try to find your class. In this case excute the java command with the -classpath options set to tell java where you classes are located.

  3. #3
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    9

    Default Examples

    Hello Java2003.

    I have created two examples for another member who had the same problems as you. Study the thread and attachments and then things should be easier for you. ;)

    Good luck. :D
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

Similar Threads

  1. Java command line
    By agouzoul in forum New To Java
    Replies: 2
    Last Post: 04-02-2008, 12:12 PM
  2. calling linux command line in java
    By fangzhong in forum New To Java
    Replies: 0
    Last Post: 02-03-2008, 05:24 PM
  3. Reading in data from file line by line
    By bluekswing in forum New To Java
    Replies: 1
    Last Post: 10-02-2007, 12:19 AM
  4. Unable to execute command line command in java
    By LordSM in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 12:23 AM
  5. Java Command Line Arguments In Eclipse IDE
    By JavaForums in forum Eclipse
    Replies: 0
    Last Post: 05-19-2007, 09:45 AM

Posting Permissions

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