Get your CodeRanch badge!*
The moose likes Beginning Java and the fly likes running problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "running problem" Watch "running problem" New topic
Author

running problem

Pradyut Bhattacharya
Ranch Hand

Joined: Aug 12, 2004
Posts: 63
i'm using jdk 1.3 with windows 2000 professional. i have set the path and the classpath in environment variables.
i can use javac very conviniently
but every time i java a program, for example
java xyz
i get the message
Exception in thread "main" java.lang.NoClassDefFoundError: xyz

my details for path and classpath are
classpath=C:\jdk1.3\lib;C:\j2sdkee1.2.1\lib\j2ee.jar
path=C:\jdk1.3\bin;C:\j2sdkee1.2.1\bin

i have used many programs earliear and they worked fine
but this a new problem. i tried using both old and new class files.

please help
Pradyut


Pradyut
http://pradyut.tk/
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Hi Pradyut,

A few suggestions:
  • Try adding . (the current directory) to your classpath
  • You've added the c:\jdk1.3\lib directory, but if you need any specific JARs in your classpath which are not part of the platform you'll need to add them individually (by name)
  • If your class "xyz" is in a package you need to run it using "java package.xyz"
  • If you post a specific error it's easier to diagnose the problem

  • Hope this helps.

    Jules
    Shashank Agarwal
    Ranch Hand

    Joined: May 20, 2004
    Posts: 105
    Try setting path for only one jdk. or else look up your code, u must have a "public static void main(String args[])" inside ur main class
    if this is not there, u'll get the main class not found exception

    Remeber the String args[]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: running problem
     
    Similar Threads
    javacommon.zip and partitioned hard drive.
    problem running Client program
    still problems with tomcat
    Tomcat Installation
    basic Problem