NoClassDefFound error

I have a problem when I try to execute a java class file.
I get the NoClassDefFound error. I went in and set my Classpath in windows xp and pointed it to my bin. I am able to compile the program but when I try to run it I get the NoClassDefFound error. I have tried various means to get it to run.
I can see the class file in the directory I am in in the CMD prompt. I can not run any java class file.
Once again I have set the Classpath and am using the same version of compiler and java.exe. I am not adding the extension .class to the end I even tried Crimson Editor and set the java.exe path and set the argument to $[FileTitle].
I unistalled all my java and reinstalled it and still have problems with running any class file even the examples that java has included.
Any help would be gratefully appreciated.

set my Classpath in windows xp and pointed it to my bin.The above is incorrect.
Delete the CLASSPATH environment variable. Do not set it again until you understand how to use it. Read the documentation here to learn that:
http://java.sun.com/javase/6/docs/technotes/tools/index.html#general
Change to the directory that contains the .class file and use this command:
java -cp . <nameOfTheClass>
IMPORTANT: include the period and surrounding spaces.

Similar Messages

  • NoClassDefFound error oracle/sql/opaque

    Hi There,
    [Using Java 1.4.2, BEA WebLogic 8.1, Oracle 9i Db]
    We're having a bit of trouble with the above error.
    In our java code, we are referencing xdb.jar and odbc14.jar but when we try to create an XMLTYPE object from an OPAQUE object we receive the NoClassDefFound error.
    Anyone with any ideas on how to get around this please?
    Many thanks,
    Neil

    Hi,
    I had the same problem...
    Put the xsu12_817.jar or xsu12_816.jar (depends on RDBMS version) in your CLASSPATH instead of xsu12.jar. (you can find xsu12_817.jar and xsu12_816.jar files in Oracle XDK).
    It should work.
    Regards
    Sash

  • "Exception in thread "main" java.lang.NoClassDefFound Error" in XP

    I was creating programs just fine for awhile. Then, for some unknown reason, I start getting the runtime error message, "Exception in thread "main" java.lang.NoClassDefFound Error." I set my PATH in the following manner:
    Start | Control Panel | Performance and Maintenance | System | Advanced | Environment Variables | Use Variables for Owner | PATH | Edit | C:\j2sdk1.4.2_04;C:\j2sdk1.4.2_04\bin;C:\j2sdk1.4.2_04\jre\bin | Ok | Ok | Ok
    I then closed the dialog boxes and restarted my computer. I then tried to run a program that ran before, only to get the same runtime error! Can someone please help me???

    NoClassDefFoundError happens because the JVM cannot find some class from your program, not because the OS cannot find your JVM (PATH regulates the latter, but not the former). JVM looks up classes in directories (or JAR files) specified through the -classpath option, like "java -classpath c:\myclasses MyMainClass". Read the online doc for the "java" launcher for more info.

  • Error:"exception in thread main:java.lang.noclassdeffound error.

    Hi,
    I am new to this java tech and programming. I just started learning and installed j2sdk1.4.0_03. I wrote a small hello world program and compiled it without any errors. When I execute the same using java hello command, I am getting an error like this: exception in thread "main" java.lang.noclassdeffound error. I am not able to resolve this issue. Please let me know the sol.
    thanks
    venkatraman

    send the program u have typedUmm... Why?
    Anyway @NovaKane: Welcome. Together with seifist and sunny we have at
    least three new posters who show enough intelligence to find chuck's
    solution (or one of the many hundreds of others like it) and the politeness
    to thank him for it. What's the forum coming to?
    If you need it there is a description of the classpath here:
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpath.html
    Again, welcome. And thanks for raising the intelligence level (and politeness
    quotient) of the fora.

  • Java.lang.NoClassDefFound Error:msgsend

    Hi,
    I am trying to run my first Java Mail program, sending mail.
    I had compiled the source - no Errors.
    Now, when i try to execute it says
    Exception in thread 'main' java.lang.NoClassDefFound Error:
    I have download the JavaMail and JAF and has put the files under proper dir and verified the class variable. I am using Jdk1.3.

    The reason of this run time error is : Java is not able to locate main method of specified class File. or class file itself is not locatable.
    Check :
    1. Either u are not in same folder where ur class file is.
    2. or If u are running from some other directory, ur class file path is not in CLASSPATH.
    3.or There will be some mistake in definition of main method.
    Bye,
    Shaan

  • Another NoClassDefFound Error. Nothing worked!

    Hi. I'm a newbie. I've gone thru the forums but cant find anything to overcome this error msg.I tried the divelog tutorial but when i tried to run using the command line
    C:\divelog.java -classpath C:\ divelog.DiveLog
    the following error occured:
    Error occured during initialization of VM
    java/lang/NoClassDefFound Error: java/lang/object
    I have J2RE 1.4.1_03 and JDK1.3.1_07 running on Win XP. My env variables are pointed to the J2RE location. Is there a compatibility problem involved?
    Please help me to get rid of the error.
    Thanks in advance.
    Regards,
    azareen

    I had this problem after installing 1.4.2_01 on Linux under slackware9.1.
    I found the resolution by running 'java -verbose' as root and as a user and comparing the output, as java ran fine for root.
    Turns out that for the user 'java -version' stoipped after loading a couple of jars, and as root it didn't.
    These jars in the JAVA_HOME/jre/lib directory only had root read/write permissions. After changing these permissions to all read and root write it worked fine for the user (so far)
    Maybe you could look into something similar if you are not the admin on the Windows environment you're working on.
    John

  • App world is showing this error "Uncaught exception: java.lang.NoClassDefFound Error"

    Few days back I received some App world updates through wireless network. After installing those updates and restarting mobile when I clicked on App world icon following error is being displayed "Uncaught exception: java.lang.NoClassDefFound Error". In fact I can't enter into appworld.
    Please suggest remedy
    Regards,
    Hitendra SIngh

    Hello hitmech07,
    Go to www.blackberry.com/appworld on your BlackBerry smartphone browser and attempt to reinstall the appliction.
    Cheers,
    -FB
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.
    Click "Accept as a Solution" for posts that have solved your issue(s)!

  • Epa2sda  java.lang.NoClassDefFound error..?

    hi,
    <b>I am using nwds 7.0.0 and ep 7 and j2sdk1.4.2_07</b>
    I have set all the class path variable as per the blog -
    https://service.sap.com/sap/support/notes/696084.
    but when i am writing the command to convert epa file to sda-
    "epa2sda ab.epa abc.sda"
    it gives  <b>Exception in thread "main"java.lang.NoClassDefFound error:</b> org/apache/tools/ant/main.
    what should i do to convert the epa file into sda file.

    hi Harini,
    my ndwd version is "7.0.0"
    This is the "sapmake.bat" file which i have been using.(giving error)
    <------->
    echo off
    setlocal
    if "%JAVA_HOME%" == "" goto nojavahome
    if "%SAPIDE_HOME%" == "" goto nosapidehome
    goto start
    :nojavahome
    echo JAVA_HOME environment variable is not set
    goto end
    :nosapidehome
    echo SAPIDE_HOME environment variable is not set
    goto end
    :start
    set ANTCLASSPATH=%SAPIDE_HOME%\IDE\IDE70\eclipse\plugins\org.apache.ant_1.5.3\ant.jar;%ANTCLASSPATH%
    set ANTCLASSPATH=%SAPIDE_HOME%\IDE\IDE70\eclipse\plugins\org.apache.ant_1.5.3\optional.jar;%ANTCLASSPATH%
    set ANTCLASSPATH=%SAPIDE_HOME%\IDE\IDE70\eclipse\plugins\com.tssap.sap.libs.xmltoolkit\lib\sapxmltoolkit.jar;%ANTCLASSPATH%
    set ANTCLASSPATH=%SAPIDE_HOME%\IDE\IDE70\eclipse\plugins\com.tssap.sap.libs.logging\lib\logging.jar;%ANTCLASSPATH%
    set ANTCLASSPATH=%SAPIDE_HOME%\IDE\IDE70\eclipse\plugins\com.sap.ide.eclipse.jarsap\lib\SLUtil.jar;%ANTCLASSPATH%
    set ANTCLASSPATH=%SAPIDE_HOME%\IDE\IDE70\eclipse\plugins\com.sap.ide.eclipse.jarsap\lib\SDMutil.jar;%ANTCLASSPATH%
    set ANTCLASSPATH=%SAPIDE_HOME%\IDE\IDE70\eclipse\plugins\com.sap.ide.eclipse.jarsap\lib\jar4sap.jar;%ANTCLASSPATH%
    if exist "%JAVA_HOME%\lib\tools.jar" set ANTCLASSPATH=%JAVA_HOME%\lib\tools.jar;%ANTCLASSPATH%
    %JAVA_HOME%\bin\java.exe -classpath "%ANTCLASSPATH%" org.apache.tools.ant.Main -Dsapmake.home="%SAPIDE_HOME%/sapmake_util" -Dbasedir="." -buildfile "%SAPIDE_HOME%/sapmake_util/build.xml" %1 %2 %3 %4 %5 %6 %7 %8 %9
    :end
    set ANTCLASSPATH=
    <----
    >

  • Could not find the main class. & java.lang.NoClassDefFound error:

    sir / madam
    I am facing problems with j2ksdk1.4.0 beta instalation on my windows 2000 advance server.
    while installing pops up a message saying could not find the main class.
    while using java or javac it says
    Exception in thread main
    java.lang.NoClassDefFound error:
    com/sun/tools/javac/main
    even when double clicking java plugin from the control panel
    I get the Java virtual machine launcher saying could not find the main class.
    I don't have any other java sdk installed.
    And i have my environment variables (classpath, path and java_home) set correctly.
    this same j2sdk1.4.0 version is installed in the windows 98 system and it's working fine.
    Kindly do help me to solve this problem.
    eagerly awaiting for your response.
    Thanking you
    Sajeev Nair
    [email protected]

    you must check with the classpath
    please see that you have not repeated %classpath%
    at the end of the class path like you do in win98.
    similiarly with %path%
    in win2000 it is automatically taken care off.

  • NoClassDefFound error when using custom Java package in scripting QPAC

    Hi,
    I compiled a little Java-package (.jar), which contains a class that uses
    com.adobe.workflow.datatype.form.FormDataTypeInstanceImpl.
    I put my library in the lib folder of JBoss (...\server\all\lib).
    Then I'm was trying to invoke my custom class in the scripting QPAC. But I'm constantly getting the error message
    NoClassDefFound com\adobe\workflow\datatype\form\FormDataTypeInstanceImpl. I already put
    adobe-wkf.jar (and various others) in the lib folder of JBoss. Without ever succeeding. Unfortunately.
    I'm going mad about this.
    Is there a way to address a custom package in the scripting QPAC, which uses
    FormDataTypeInstanceImpl?
    Steve

    Removing the LiceCycle jars from the lib folder did not work. I still get the same error message.
    What I wanted to do is provide some basic utilities, without having to spend a lot of time designing QPAC user interfaces.
    My utility class contains methods like this one:
    @param 
    pFormData
    @return
    @throws 
    ParserConfigurationException
    @throws 
    SAXException
    @throws 
    IOException
    public static 
    org.w3c.dom.Document formToXml
    FormDataTypeInstanceImpl pFormData
    throws 
    ParserConfigurationException, SAXException, IOException 
    byte
    data = pFormData.getXFAData
    InputStream objXMLInputStream = 
    new 
    ByteArrayInputStream
    data
    // create new Document object
    DocumentBuilderFactory objFactory = DocumentBuilderFactory.newInstance
    DocumentBuilder objBuilder = objFactory.newDocumentBuilder
    org.w3c.dom.Document objDocument = objBuilder.parse
    objXMLInputStream
    return 
    objDocument;
    Even without ever invoking the aforementioned method, I get the error
    NoClassDefFound: FormDataTypeInstanceImpl. Which is pretty weird.
    Do I have to write my own classloader?
    Steve

  • Java.lang.noclassdeffound error when installing oracle BI EE 10g

    Hello,
    I am trying to install Oracle BI EE 10g and I am getting an error "java.lang.noclassdeffound in thread main" The install shield closes on clicking OK on the error message box.
    I have installed JDK1.6.
    Please help.
    Thanks,
    Krishna.

    Have you actually started the OC4J? Test that your webservice is running by access the root home page.

  • Java.lang.NoClassDefFound Error while invoking dbua(9.2.0.8)on Sun Solaris.

    Hi Friends,
    I had installed Oracle 9.2.0.1(software alone) on Sun solaris box and then i installed the patchset 9.2.0.8 on the same Oracle 9i Home.It's installed.
    But when i try to run dbca to cretae a database from $ORACLE_HOME/bin it throws the error:
    java.lang.NoClassDefFoundError
    i had set the PATH,ORACLE_SID,ORACLE_HOME,LD_LIBRARY_PATH but still getting the error.
    Please suggest a fix.
    Regrads,
    Arun

    Do you have JAVA_HOME set in your environment?
    What's the result of
    env
    Make sure DBCA is calling the java under $ORACLE_HOME not from other installation.

  • NoClassDefFound error wl9.2

    I am trying to deploy a war archive to a remote server running 9.2.
    I'm using the admin console to do this.
    When I start the application, I am getting the NoClassDef found error.
    I have tested this same war on my local instance running wl 10.0.3 and it is working fine.
    I have also checked the war file and it does contain the class file that is reportedly missing.
    Any ideas? Please help, thanks.

    A CDNF error would not occur if you simply had a JRE version mismatch.
    It would help to get more detail. What is the fully-qualified class name that isn't being found?

  • Problems with java.lang.NoClassDefFound error *solved*

    realising my stupidity I have solved the problem
    I am quite new to java and I have been using the Java for Dummies book to help me to learn it. I decided to use the command line tools instead of an IDE and hadn't encountered any problems until recently. I took a break from learning Java after reaching the end of the book but have decided to come back to it. The problem now is that when I run my programs I get the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: helloworld (wrong anme: HelloWorld)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.access$000(Unknown Source)
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPriviledged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.localClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    This occurs from a simple hello world program:
    class HelloWorld
       public static void main(String[] args)
          System.out.println("Hello, World!");
    }I have no idea what the problem is, although by looking at similar threads it would appear that it may be something to do with the classpath variables however I do not know much about this as I followed a tutorial on the internet to set the classpath up.
    Edited by: this_is_phil on Jun 19, 2008 11:11 AM

    this_is_phil wrote:
    Exception in thread "main" java.lang.NoClassDefFoundError: helloworld (wrong anme: HelloWorld)This part of the error message means you typed in "helloworld" but the class that java found was named HelloWorld. In Java, those are different - java is case sensitive. It will work if you enter HelloWorld.

  • NoClassDefFound Error in Windows NT

    Hi all...I am having problem running my java programs.
    Due to some technical problems, the help desk in our company had to rebuild my computer. Its an NT workstation.
    And after the system is rebuilt, I installed the j2sdk1.4.0_01 when all the problems started. I am able to compile all the programs, but whatever I do I am not able to run the programs.
    It is giving me the error ::
    Exception in thread "main" java.lang.NoClassDefFoundError
    i dont think there is any problem in my classpath. I checked and double checked it. I am able to run the programs from an IDE, but not from the command prompt.
    And the most weird thing is: I am getting the same error even if I copy the class file into the j2sdk1.4.0_01\bin directory and run it with java.
    Any kind of help on how I am going to solve this will be highly appreciated.
    Thank you all
    -shyam

    I use NT. I agree this sounds like a classpath problem.
    1. Go to a fresh command line. Type SET CLASSPATH. Check the results.
    2. From the same command line type PATH. NT has its own Java unless you have removed it. If ..\winnt\system32 comes before the directory where you installed java then the old Java is going to be used.
    The IDE will set up its own PATH and CLASSPATH before doing anything else. That is why programs run from the IDE but not the command line.
    I normally create a batch file named JAVAPATH.CMD which overrides PATH and CLASSPATH. When I go to the command prompt I first execute JAVAPATH then I do my work.
    Why you might ask. Permanently changing PATH or CLASSPATH in the System icon my interfer with other applications which depend upon the system setting of these values. By running JAVAPATH the PATH and CLASSPATH are changed only for that session.
    Good luck

Maybe you are looking for

  • Re-using Segments Created via API or Re-creating Every Time?

    Hi All, Wanted to get your thoughts on this... We have been able to create Segments via the API, however, which way to go: OPTION 1: Re-use Segment if there are no additions or deletions (changes) to the list? or OPTION 2: Re-create the Segment every

  • 16:9 Black Bars

    I shot my movie in 16:9, but I don't have any bars at the top or bottom of my image. How can I get these? My main thing is that I want to apply subtitles. It would be nice to have the black background. I'm using bright yellow text and I really like i

  • Do I have to have an Airport?

    I can't get my new Airport express to connect to my existing Netgear wireless network. Do I have to have an Apple Airport to make the connection? I am getting the flashing amber light. Thanks, Ben

  • Chart Bug

    I'm wondering if others are having this problem I am having: I have a line chart with 8 series.  Default colors for the chart. Two series are blue but very slightly different shades. Two are green but very slightly different shades. If I select one o

  • My Palm M105 is Bust!

    Ok it was donkies years old so its not the end of the world. I want to buy the modern equivilent the Z22 or Tungsten E2 handheld.  I´m a simple guy. The question is whether I will be able to directly upload my old contacts/address book and diary via