Java help needed

Discussion in 'Java' started by mhk, Sep 22, 2003.

  1. mhk

    mhk Guest

    Hi ,

    i am having a problem while running java file , i mean i can compile
    file correctly using "javac filename.java " but when i try to run it
    using "java filename", i get following error

    Exception in thread "main" java.lang.NoClassDefFoundError

    I checked it on the web but didnt get any help. definately its about
    missing class path problem but i really dont know how to solve it.

    Please help me ...

    Thanks in advance.

    jeff
     
    mhk, Sep 22, 2003
    #1
    1. Advertising

  2. mhk wrote:

    > Hi ,
    >
    > i am having a problem while running java file , i mean i can compile
    > file correctly using "javac filename.java " but when i try to run it
    > using "java filename", i get following error
    >
    > Exception in thread "main" java.lang.NoClassDefFoundError
    >
    > I checked it on the web but didnt get any help. definately its about
    > missing class path problem but i really dont know how to solve it.
    >
    > Please help me ...
    >
    > Thanks in advance.
    >
    > jeff


    try java -cp . filename

    That sets the classpath to the current directory.
    If you need to have other things in your classpath, just append the . to the
    CLASSPATH environment variable.

    --
    mvg,
    Christophe Vanfleteren
     
    Christophe Vanfleteren, Sep 22, 2003
    #2
    1. Advertising

  3. mhk wrote:

    > Hi ,
    >
    > i am having a problem while running java file , i mean i can compile
    > file correctly using "javac filename.java " but when i try to run it
    > using "java filename", i get following error
    >
    > Exception in thread "main" java.lang.NoClassDefFoundError
    >
    > I checked it on the web but didnt get any help. definately its about
    > missing class path problem but i really dont know how to solve it.


    Very likely you have a classpath problem. You may need to instruct the
    JVM to look in the working directory for classes. For instance,

    java -cp . MyClass


    John Bollinger
     
    John C. Bollinger, Sep 22, 2003
    #3
  4. mhk

    mhk Guest

    Thank you sooooooo much




    John C. Bollinger wrote:
    > mhk wrote:
    >
    >> Hi ,
    >>
    >> i am having a problem while running java file , i mean i can compile
    >> file correctly using "javac filename.java " but when i try to run it
    >> using "java filename", i get following error
    >>
    >> Exception in thread "main" java.lang.NoClassDefFoundError
    >>
    >> I checked it on the web but didnt get any help. definately its about
    >> missing class path problem but i really dont know how to solve it.

    >
    >
    > Very likely you have a classpath problem. You may need to instruct the
    > JVM to look in the working directory for classes. For instance,
    >
    > java -cp . MyClass
    >
    >
    > John Bollinger
    >
    >
     
    mhk, Sep 22, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. steven robinson
    Replies:
    10
    Views:
    1,109
    Tim Tyler
    Nov 27, 2003
  2. Avizz
    Replies:
    1
    Views:
    4,462
  3. Thomas Nick
    Replies:
    0
    Views:
    1,973
    Thomas Nick
    Jun 13, 2005
  4. Ryan Macy

    Ideas needed & help needed!

    Ryan Macy, Jul 19, 2006, in forum: Ruby
    Replies:
    2
    Views:
    543
    Ryan Macy
    Jul 19, 2006
  5. John Farold
    Replies:
    0
    Views:
    408
    John Farold
    Aug 29, 2012
Loading...

Share This Page