Java.lang.NoClassDefFound

Can anyone point me in the right direction with this error;
Exception in Thread "main" java.lang.NoClassDefFoundError: app2
where app2 is the name of my application. My application contains 3 classes. app2 is the main class which is constructed by the main method. app2 calls the next class, which calls the third. the application was working before and i can't find what i changed.
I'd really appreciate it if some one could give me an idea what this error means and any possinle causes.
Thanks

I'm kinda new too, so hopefully in trying to answer people, I'll discover that I too am wrong, and will be corrected, and will learn in the process.
Anyhow, depending on what O/S ya run, ya have to set the classpath in different ways. I use a .bat file that I run in dos when I first open dos. I edit the bat file to have the classpath set to whatever I need. I have multiple bat files and I use the one for the project that I'm currently working on.
a dot means the current class, otherwise you can just just put in the path to the directory, and you can have multiple things set, separating them by a semicolon.
so like a bat file like so:
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;c:\jdk1.3.0_02\bin
SET CLASSPATH=.;C:\JavaProjects
cd c:\JavaProjects
Add directories ya wanna use w/semicolons separating them, then give it all a go once again.
Or you can download jbuilder or somesuch and just hit the compile button.
If I'm wrong about anything, I hope someone will tell me, I wanna know if I am.

Similar Messages

  • "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

  • HT3633 I have an error message that reads: java.lang.noclassdefFounder - need to fix can anyone help?

    I have an error message that reads: java.lang.noclassdefFounder - need to fix can anyone help?

    That's a bug in whatever Java program you're running.
    That's not an error specific to OS X.
    (There's usually a whole lot more text dumped by Java, too.)
    Check with whoever wrote or is supporting the package you're working with.

  • 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)!

  • 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.

  • [solved] java.lang.NoClassDefFound using E-mail NotificationService

    Hi,
    I have the following Java exception trying to send an email with the NotificationService :
    java.lang.NoClassDefFound
    The log does not tell much nore than that ... Am I missing any JAR file ? Any hint ?
    EDIT : solved ! One of the tags in ns_emails.xml was missing.
    Message was edited by:
    Alexandre Abric

    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

  • 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.

  • Java.lang.NoClassDefFound Exception ????

    hai friends,
    plz let me know why we will get java.lang.NoClassDefFound Exception?
    thanks in advance

    If you are getting it when you run the program from the command line, the most likely reason is you've misspelled the class name or not included its package correctly.
    In most other situation it means you've got the classpath wrong.
    Google for Java classpath.

  • 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.

  • 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.

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

    C:\myjava>java JdbcCheckup
    Exception in thread "main" java.lang.NoClassDefFoundError: JdbcCheckup
    C:\myjava>java -cp %CLASSPATH%; . JdbcCheckup
    Exception in thread "main" java.lang.NoClassDefFoundError: c:\tomcat_4\common\li
    b\servlet/jar;
    C:\myjava>
    here is my classpath. There is 'c:\tomcat_4\common\lib\servlet/jar;' its listed as a .jar file?
    why cant i compile?
    CLASSPATH=c:\oracle\ora81\jdbc\lib\classes12.zip; c:\tomcat_4\common\lib\serv
    t.jar; c:\eclipse; c:\tomcat_4\examples\WEB-INF\classes;c:\oracle\ora81\jlib\b
    raphbean.jar;c:\oracle\ora81\jlib\LW_PfjBean.jar;c:\oracle\ora81\jlib\bigraphb
    n-nls.zip

    Either remove the erroneous spaces between your classpath elements, or do:
    java -cp "%CPASSPATH";." JdbcCheckup
    (notice the double-quotes)
    The way you did it, as soon as it saw the first space (after your classes12.zip entry), it thought that was the end of the classpath.

  • "Exception in thread "main" java.lang.NoClassDefFound: classname" error.

    Here's my code:
    public class Hello
    public static void main( String[] args )
    System.out.println( "Hello!" );
    it compiles but it wont run. it encounters this error: " Exception in thread "main" java.lang.NoClassDefFoundError: Hello"
    Since I am using jdk1.3, my path is "c:\windows;c:\windows\command;c:\progra~1\dell\resolu~1\common\bin;c:\jdk1.3\bin"
    another error I noticed in my computer were these while running Calculator.java:
    Calculator.java:11: cannot resolve symbol
    symbol: class Calc
    location: class Calculator
    Calc calculator;
    Calculator.java:36: cannot resolve symbol
    symbol: class Calc
    location: class Calculator
    calculator = new Calc();
    2 errors
    Yet my Calculator.java, Calculator.class, Calc.java, Calc.class, Calculator.html files are all in one folder.
    Since I am using jdk1.3, my path is "path=c:\windows;c:\windows\command;c:\progra~dell\resolu~1\common\bin;c:\jdk1.3\bin;"
    I would greatly appreciate your help.
    Thank you very much!=)

    hi!
    set the classpath to the relative path "."!
    in the command box type this:
    SET CLASSPATH=.;
    then it should work!
    visit: >> http://www.menzsoft.ch <<
    greets

  • Data Warehouse:java.lang.NoClassDefFound Error while using OWB API for Java

    I was writing code to use the OWB APIs for Java:
    I have imported the folowing files:
    oracle.owb.connection.RepositoryManager;
    oracle.owb.connection.OWBConnection;
    oracle.owb.connection.ConnectionFailureException;
    when jvm tries to get instance of Repositary Manger by the following code
    reposManager = RepositoryManager.getInstance();
    I get the following exception:
    Exception in thread main
    java.lang.NoClassDefFoundError: com/objectspace/jgl/HashMap
    I have checked my OWB and Java environment but I cant locate com/objectspace/jgl.jar file. Can some one tell me were this jar is located in so i can import it.

    Either use some criteria you develop related to one of the keys on the table or use some sort of record limiting method.
    Note the method of limiting will vary related to the database you are using. You will have to look at the documentation.
    For example I am told this will work in MySQL to get 200 records starting at record 100.
    SELECT * FROM myTable ORDER BY whatever ASC LIMIT 100,200
    Because you are running out of memroy I assume the table is large,
    I am not sure what the impact of the above will have on performance because if in the above if the order by is not based on an index at the server level all the records will be selected and sorted before the records are limited.
    I would make sure you have an appropriate index.
    If you use the advanced search over the user forums using "resultset paging" and possibility the database you are using you should be able to get some ideas.
    I hope this makes sense to you.
    rykk

Maybe you are looking for

  • Is there a way to save music from iTunes onto CD?

    I know it is possible to export tunes to a CD from iTunes. However the way that I do it uses the same amount of space on the CD as the original tracks took up? Is there a way of compressing the files into another format so that I can save more than o

  • Can't connect wireless printer to wired PC in wireless/wired network

    We have HP Officejet 6500A Plus (E710n-z) printer Wireless router with 4 ethernet connections (SAGEMCOM 2864) - some pcs connect wirelessly and we have 3 connected via ethernet (network has several printers, 2 netbooks, IPad, 2 laptops and 4PCs curre

  • Why can't I can't control export settings in iMovie '13

    After upgrading to the new iMovie I don't have the ability to have more control of how I export the video files. Before I was able to control more of the file size and what type of file output I wanted. Where has this gone?

  • Define main objects for Drag & Relate between BW 3.1 and EP6

    hi all. We are trying to implement Drag & Relate between BW 3.1 and EP6. We have 2 different BW reports based on the same object "0MATERIAL". One of them should be a source and the other is the target. When creating the iViews for these reports the "

  • Hp office jet pro 8600 air printing scale issues.

    Can you help me figure out how I can fit my document (to scale correctly). I've tried printing it direct print using iOS air print and through the hp app. Thank you for your time!