Hello World  App : Exception in thread "main" java.lang.NoClassDefFoundErro

Hi
I have downloaded a latest version of JDK, I have several other versions on my machine from other times i endeavored to work on Java, but never got to doing so.
I have compiled the HelloWorldApp (code below) but when i try to run it, I get the error below: My java version is listed as 1.5.0_06. Any insight would be great.
F:\GamingExtravaGanza>java HelloWorldApp.class
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp/class
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
}F:\GamingExtravaGanza>java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
Mike

I had tried without the class extension, too. Anyone have ideas for why i am getting the error ?
F:\GamingExtravaGanza>java HelloWorldApp
Exception in thread "main" java.lang.UnsupportedClassVersionError:
umber in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Sour
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Metho
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Sourc
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Similar Messages

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

    Hi,
    My program compiler with below command
    C:\Sun\AppServer\jdk\bin>javac -classpath .;db2jcc_license_cisuz.jar H:\apps\xp\
    Desktop\apache-tomcat-6.0.10\webapps\test\WEB-INF\classes\GOOG\MLRCurrentDate.ja
    va
    When i try to run my program i get the below error
    C:\Sun\AppServer\jdk\bin>java -classpath .;db2jcc_license_cisuz.jar H:\apps\xp\D
    esktop\apache-tomcat-6.0.10\webapps\test\WEB-INF\classes\GOOG\MLRCurrentDate
    Exception in thread "main" java.lang.NoClassDefFoundError: H:\apps\xp\Desktop\ap
    ache-tomcat-6/0/10\webapps\test\WEB-INF\classes\GOOG\MLRCurrentDate

    here it is
    package GOOG;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class MLRCurrentDate
    //    public MLRCurrentDate(){}
         public static StringBuffer invoke(String program) throws java.io.IOException, java.lang.InterruptedException
                   System.out.println("invoking program: " + program);
                   Process p = Runtime.getRuntime().exec(program);
                   int exitValue = p.waitFor();
                   BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
                   StringBuffer sb = new StringBuffer();
                   String line;while ((line = br.readLine()) != null)
                   {  sb.append(line).append("\n");}
                   return sb;
              public static void main(String[] argv)
                   try
                   System.out.println("invoker start");
                   StringBuffer retval = invoke("c:\\Program Files\\IBM\\OnDemand for WinNT\\bin\\arsdate -g");
                   String answer = retval.toString();
                   String retval_modified=retval.substring(7);
                   System.out.println("Current Date " + retval);
                   StringBuffer retval1 = invoke("c:\\Program Files\\IBM\\OnDemand for WinNT\\bin\\arsdate -z "+retval_modified);
                   String answer1 = retval1.toString();
                   String starttimestamp=retval1.substring(12,22);
                   String endtimestamp=retval1.substring(23);
                   int lg =retval1.length();
                   System.out.println("Current timestamp " + answer1);
                   System.out.println("Start timestamp " + starttimestamp);
                   System.out.println("End timestamp " + endtimestamp);
                   catch(java.io.IOException e)
                        System.out.println("IOException caught: " + e);
                   catch(java.lang.InterruptedException e)
                        System.out.println("InterruptedException caught: " + e);
         }

  • Exception in thread "main" java.lang.NoClassDefFoundError: Hello/java

    I installed jdk 1.5 on my windows XP SP2 system and tried to run a simple program:
    public class Hello {
         public static void main(String[] args) {
              System.out.println("Hello world!!");
    }     but i get the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: Hello/java
    I've set the classpath as:
    CLASSPATH=C:\Java\jdk1.5.0_09\lib;
    and path variableas:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM;%SYSTEMROOT%\system32\WBEMC:\PROGRA~1\COMMON~1\AUTODE~1;C:\Java\jdk1.5.0_09\bin;c:\j2sdkee1.3.1\bin;c:\Java\jdk1.5.0_09\lib;
    I didn't have this problem when i was using SP1 of windows xp...
    Plz help!!

    Oh!! I didn't know this was a famous question of this forum!!
    Just added a semi-colon at the end of classpath and it works fine.... although a strange solution

  • Exception in thread "main" java.lang.NoClassDefFoundError: Hello

    Hi @ all!
    I'm a newbie and maybe for advanced developers my problem is just a tiny one, but I can't solve it. So everytime I want to run my Hello.class in a DOS window with the commandline: java Hello, it print this error:
    Exception in thread "main" java.lang.NoClassDefFoundError: Hello
    Who can I solve it???

    This is a common problem and everybody has had it! The Java runtime cannot find your class.
    - make sure that your compilation worked and the "Hello.class" file exists.
    - To test whether this is a classpath problem, navigate to the directory where "Hello.class" is located and then run "Java Hello" again (assumes you are not yet using packages). If it works, then add the directory to your classpath and you should be able to run from anywhere.
    - if it doesn't work, post again with the error.
    Good Luck

  • Exception in thread "main" java.lang.NullPointerException error JDeveloper 12c

    Hello,
    I am trying to call a java stored procedure in java application. I am using ORACLE database and JDeveloper.
    I am getting error "Exception in thread "main" java.lang.NullPointerException. I have no idea what have I been doing wrong.
    I have a table "Beer" and I want to select all the data out with a stored procedure which I call out of Java app.
    I have a java.class file Store_A.java which I have loaded into the ORACLE database with LOADJAVA :
        import java.sql.*;
        import java.io.*;
        public class Store_a {
          public static void apskatit ()
            throws SQLException
            { String sql =
              "SELECT * FROM Beer";
            try { Connection conn = DriverManager.getConnection("jdbc:default:connection:");
              PreparedStatement pstmt = conn.prepareStatement(sql);
              ResultSet rset = pstmt.executeQuery();
              rset.close();
              pstmt.close();
            catch (SQLException e) {System.err.println(e.getMessage());
    Then I have created a procedure which I plan to call out in java:
        CREATE OR REPLACE PACKAGE Store_a AS
        PROCEDURE apskatit;
        END Store_a;
        CREATE OR REPLACE PACKAGE BODY Store_a AS
        PROCEDURE apskatit AS LANGUAGE JAVA
        NAME 'Store_a.apskatit()';
        END Store_a;
    And I have a java file that I have created with JDeveloper 12c:
        import java.sql.Connection;
        import java.sql.DriverManager;
        import java.sql.ResultSet;
        import java.sql.SQLException;
        public class Class1 {
             * @param args
            public static void main(String[] args) throws SQLException {
                Connection conn = null;
                try {
                    Class.forName("oracle.jdbc.driver.OracleDriver");
                    //Izveidojam savienojumu
                    conn = DriverManager.getConnection("jdbc.oracle.thin:@localhost:1521", "SYSTEM", "asdasd");
                    // Izveidojam callable statement
                    CallableStatement stmt = conn.prepareCall("CALL Store_a.apskatit()");
                    ResultSet resul = stmt.executeQuery();
                    while (resul.next()) {
                        System.out.println(resul.getInt(1) + "\t" + resul.getString(2));
                } catch (ClassNotFoundException e) {
                    e.printStackTrace();
                } finally {
                    try {
                        conn.close();
                    } catch (SQLException e) {
                        e.printStackTrace();
    When I try to run the java file, I get this error "Exception in thread "main" java.lang.NullPointerException at client.Class1.main(Class1.java:29).
    So the line I get error in is "conn.close();"
    How to fix this?
    Thank you very much in advance.

    I am trying to call a java stored procedure in java application. I am using ORACLE database and JDeveloper.
    I am getting error "Exception in thread "main" java.lang.NullPointerException. I have no idea what have I been doing wrong.
    Maybe you haven't read it yet but I told you in your other thread what you were doing wrong and, step by step, how to address the problem.
    https://forums.oracle.com/thread/2611124
    I'm not going to repeat everything again just this one main piece of advice:
    Until you get you code working outside the database don't even bother trying to load it into the DB and create a Java stored procedure.
    You are trying to deal with too many different issues at the same time. Unless you solve your primary Java problem by fixing the code outside the DB you will have nothing but problems loading it into the DB.
    And just get rid of this line of code - you don't need it anymore and it hasn't been done like that for many years now:
    Class.forName("oracle.jdbc.driver.OracleDriver");

  • Error after compile Exception in thread "main" java.lang.NoClassDefFoundErr

    Hi I am very new to Java programming, right now I am using a mac os 10.49
    I can create java documents using bbedit and then they compile when i type
    javac.
    But when i type java *.java I get the following error
    Exception in thread "main" java.lang.NoClassDefFoundError
    If I type java "filename"
    without the .java at the end of the file the terminal has no response
    I understand i am supposed to some how set the classpath but i do not know how to do this
    Also I can create and compile and then run my java in the eclipse program that i have installed, but not from terminal and im not sure why.
    Thanks for the help.

    I understand i am supposed to some how set the classpath but i do not know how
    to do thisThere is no need to set a system variable CLASSPATH, it is inflexible to do so, and it can lead to unpredictable behaviour.
    You should be able to compile and run programs from the command line, specifying the classpath as part of the commands you use.
    (1) For instance, you can create a file HelloWorld.java with the following contents:public class HelloWorld {
        public static void main(String args[]) {
            System.out.println("Hello world");
    }(2) From the command line (console) navigate to the folder (directory) containing this file and compile it with the commandjavac -cp . HelloWorld.javaThe "-cp ." part is what specifies the classpath. Note that it is a file that is being compiled so we specify the actual file name including the extension. At this point you should be able to check that the HelloWorld.class file has been created.
    (3) From the same folder (directory) you run the program withjava -cp . HelloWorldThe classpath is being specified in the same way as before. It is a class that is being invoked, so we don't specify a filename. (much less use wildcards like *).
    Documentation for the java and javac tools (and others) are linked to from this page: http://java.sun.com/javase/6/docs/index.html

  • Help me solving this exception: Exception in thread "main" java.lang...

    Dear,
    I have "test" class:
    public class test{
    public static void main(String argv[]){
    System.out.println("Hello world!");
    I use below command to compiler & run this class:
    C:\> javac test.java
    There is no problem and I get file: test.class
    After that, I use:
    C:\> java test
    I meet this message and the class cannot be run:
    Exception in thread "main" java.lang.NoClassDefFoundError: test
    Please help me to solve this problem.
    Regards,
    Cuong Ha

    before running set classpath
    like this type in command prompt
    suppose this class file in in folder c:\abc
    set classpath=%classpath%;C:\abc\
    and now run ur code
    or
    i think this is better solution not try aboce try this first
    before running
    type this
    set path=%path%;c:\jdk1.3\bin
    where 'c:\jdk1.3\bin' is the path where ur jdk is installed

  • Exception in thread "main" java.lang.NoClassDefFoundError: Helloworld

    Hi Java Experts,
    I am at a lost to how Java searches for all the classes when running a program. Below are the following steps I have taken to try a simple basic HelloWorld.java program on the command prompt on Windows XP (SP2) platform:
    ( i ) Installed both jdk1.5.0_09 and Netbeans IDE 5.0 and working properly.
    ( ii ) The source file is located in F:\Documents and Settings\abc\HeadFirstDesignPattern\src\ch11 and the compiled file is in F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes\ch11 which was compiled in Netbeans.
    ( iii ) No problem compiling & running this program in Netbeans.
    ( iv ) The RUN CLASSPATH in Netbeans is F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes.
    ( v ) No CLASSPATH variable has been set.
    ( vi ) The HelloWorld program looks like this:
    package ch11;
    public class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Hello World!");
    ( vi ) Got the message
    "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld"
    when running a combination of the following Java commands:
    ( a ) cd F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes
    ( b ) java HelloWorld, or
    java -cp . HelloWorld or java -cp "." HelloWorld, or
    java -cp F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes" HelloWorld, or
    java -cp F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes;. HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";. HelloWorld, or
    java -cp "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";. HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";"." HelloWorld, or
    java -cp "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";. HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";"." ch11\HelloWorld.
    It is the package location which is a subdirectory of F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes which caused Java not to find this program. I had no problem running it if the HelloWorld.java was moved one level up. ie from F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes\ch11 to F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes.
    I have written Java in the last year mostly on Netbeans without any problem running them.
    The reason for having to learn to run Java on the command line is so that I could add arguments to the program which I couldn't do in Netbeans just yet.
    I have gone through a lot of the articles from Java forums, Google searches but yet to have found a solution.
    Many thanks,
    Netbeans Fan

    I am getting the same problem when running the same program on a Fedora 4.0 (Redhat Linux 10) system, together with Netbeans 5.5 and JDK1.5.0_09. Again, I have no such problem when running the same program in Netbeans.
    Here are the steps that I have taken as follows:
    $ hostname
    spisu07.stvincents.com.au
    $ uname -a
    Linux spisu07.stvincents.com.au 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686
    $ pwd
    /home/dbi/HeadFirstDesignPattern/build/classes/ch11a
    $ cd ..
    $ pwd
    /home/dbi/HeadFirstDesignPattern/build/classes
    $ ls
    ch11a
    $ ls ch11a
    GumballMachine.class GumballMonitor.class NoQuarterState.class State.class
    GumballMachineRemote.class GumballMonitorTestDrive.class SoldOutState.class WinnerState.class
    GumballMachineTestDrive.class HasQuarterState.class SoldState.class
    $ java -cp . ch11a.GumballMachineTestDrive
    Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: ch11a.GumballMachineTestDrive
    at java.lang.VMClassLoader.transformException(java.lang.Class, java.lang.Throwable) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
    Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
    at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)file:///usr/share/doc/HTML/index.html
    ...4 more
    $ echo $PATH
    /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/opt/netbeans-5.5/bin:/etc/alternatives/.:/opt/netbeans-5.5/bin:/opt/jdk1.5.0_09:/etc/alternatives/.
    $ echo $JAVA_HOME
    $ echo $CLASSPATH
    Any suggestions?
    Thanks,
    Henry

  • Exception in thread "main" java.lang.NoClassDefFoundError: HW

    I am very new to java. Tried to take the time to learn but got wrapped up in other things. Now I am back to learn and here is what I am getting. I don't know if it has anything to do with java required files being in a different directory or what. I have my java sdk files in C:\Program Files\Java\jre1.6.0_05\ and the source file is in C:\Java
    Here is more information.
    My Error at runtime:_
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp
    My actions in the shell:_
    C:\Java>javac HW.java
    C:\Java>java HW
    Exception in thread "main" java.lang.NoClassDefFoundError: HW
    Caused by: java.lang.ClassNotFoundException: HW
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    My Source:_
    * The HelloWorldApp class implements an application that
    * simply prints "Hello World!" to standard output.
    class HW {
        public static void main(String[] args) {
            System.out.println("Hello World!"); // Display the string.
    }

    My Error at runtime:_
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp
    Exception in thread "main" java.lang.NoClassDefFoundError: HW
    Caused by: java.lang.ClassNotFoundException: HWO_o
    That's two different errors.
    Try to execute with:
    java -cp . HW

  • "Exception in thread "main" java.lang. No Class Def Found Error: Env"

    iam getting this erro message when i want to run the
    java program "Hello World"
    "Exception in thread "main" java.lang. No Class Def Found Error: Env"
    I have set environment variable for classpath and path for the jdk1.3.
    It is getting compiled without any error. When i try to run it it spits this error message:
    Help me......

    The problem could be from several reasons.
    If you're trying to run HelloWorld.java, you're class should defined as
    public class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Hello World");
    This program must be in a file called HelloWorld.java
    to compile-- javac HelloWorld.java
    fo run--- java HelloWorld
    1. The class has to be public
    2. you must have a main method.
    3. The file must be named the name of your class(HelloWorld) with a .java extension.
    4. After you compile make sure there is a gile called HelloWorld.class in the directory you're working in
    Steve

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

  • Exception in thread "main" java.lang.NoSuchMethodeError: main

    I'm trying to learn Java, but even the simple HelloWord won't run.
    It compiles fine with: javac HelloWorld.java
    But when I run the program with: java Helloworld or java -classpath . HelloWorld
    I always get the following error message: Exception in thread "main" java.lang.NoSuchMethodeError: main
    Path = ....;C:\j2sdk1.4.1\bin
    Classpath = C:\j2sdk1.4.1\lib\tools.jar;c:\j2sdk1.4.1\src.zip;c:\Java
    c:\Java is where I've stored HelloWorld.java.
    I'm using Java 2 SDK 1.4.1 on a Windows XP Pro platform.
    Here the simple code for HelloWorld:
    public class HelloWorld{
    public static void main(String[] args){
    System.out.println("Hello World!");
    Who out there can help me along. I want to learn Java, but if I can't even run the simplest application, it's hopeless.
    You can mail me: [email protected]
    or leave a message here.
    thx

    It should run with things as you've set them up. I copied, compiled and ran the program ok.
    Watch your capitalization; there is an error in your post (but maybe you just posted wrong):
    But when I run the program with: java Helloworld or java -classpath . HelloWorldSearch for another file that has the same name - but is an applet, without the main method; that is what the error is saying it found.
    Delete all the HelloWorld .java & .class files, recreate the program file, recompile and try running the new copy. There may be a non-visible error in the file.
    Make sure you run as follows:
    In the same directory as HelloWorld.java, enter "javac" - the program should print out a list of options, if not, set your PATH - see below.
    In the same directory as HelloWorld.java, enter "javac HelloWorld.java" and the javac compiler will create HelloWorld.class. If it was successful it will not give any messages. Check that the file is created.
    In the same directory as HelloWorld.java, enter "java -cp . HelloWorld" with the spaces and the period. The program will run.
    Here is additional information:
    The Path is a set of pointers that Windows uses to locate programs that you execute, like javac.exe and java.exe. This setting is explained here:
    http://java.sun.com/j2se/1.4/install-windows.html
    Scroll down to: 5. Update the PATH variable
    (you should have already done this as part of the s/w installation)
    The CLASSPATH is another set of pointers that is used by Java to find the files that you create and want compiled and/or run. This setting is explained here:
    Setting the Classpath:
    http://java.sun.com/j2se/1.4/docs/tooldocs/windows/classpath.html
    [NOTE: always start your classpath with ".;" which means the current directory. See my classpath, below]
    How Classes are Found:
    http://java.sun.com/j2se/1.4/docs/tooldocs/findingclasses.html
    Examples:
    This is my path
    PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BATCH;C:\J2SDK1.4.1\BIN;C:\PROGRA~1\UTILIT~1;C:\PROGRA~1\WIN98RK
    This is my classpath
    CLASSPATH=.;C:\mjava;C:\mnrx;C:\NetRexx\lib\NetRexxC.jar;C:\j2sdk1.4.1\lib\tools.jar;C:\NetRexx\NrxRedBk

  • Windows 2000: Exception in thread "main" java.lang.NoClassDefFoundError

    I've had much success using Java 1.4.0-beta under Win98. After upgrading to Win2000, I can't get Java to execute the class file. Everything compiles just fine, but when I attempt to execute the program, I get the following error (ics 21 is the folder with all my files, Hello is the program):
    C:\ics 21>java Hello
    Exception in thread "main" java.lang.NoClassDefFoundError: Hello
    Source code for the highly complex and mind boggling "Hello World!" program I'm attempting to run:
    public class Hello
         public static void main(String[] args)
              System.out.println("Hello world!");
    My PATH is setup just fine trust me, and my CLASSPATH ain't too shabby either. Like I said, everything compiles fine, it just doesn't run. Any help would be greatly appreciated!

    The Classpath setting is a list of directories in which the javac compiler and JVM search to find classes. That's why your error is almost certainly a Classpath problem. Your class Hello is in a file name Hello.class. The directory that holds Hello.class must be in your Classpath. One way to achieve this is to include . (the current directory) in your Classpath and CD to the directory where Hello.class is.

  • Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp

    I have set the path, classpath and also compiled the HelloWorldApp.java file and my main is public static void main.
    public class HelloWorldApp
    public static void main(String[] args)
    // Display "Hello World!"
    System.out.println("Hello World!");
    I still get this error
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp

    For better understanding:
    I have set the classpath in the autoexec.bat following:
    set CLASSPATH="C:\TEST;.;";
    and I have a userdefined class in c:\jdk1.3.1_01\jre\lib\ext\myclass.jar
    compiling works, but when I run the program in c:\TEST\Hello.java I get the java.lang.NoClassDefFoundError Message.
    My source code looks like this:
    import myclass.*;
    public class Hello extends MyClass{
         public static void main(String[] args)     {
              System.out.println("Hello");

  • Exception in thread "main" java.lang.NoClassDefFoundError: oracle/apex/APEX

    Hi All,
    Getting the above error when running the following export utility:
    $ java oracle/apex/APEXExport
    ABove error is thrown.
    I have looked at most blogs suggested by ML.
    Here are my env params:
    echo $CLASSPATH
    /u01/app/oracle/product/11.2.0/db_1/jdbc/lib/ojdbc5dms.jar
    ( No, i don't see any classes12.jar. The classes12.zip resides in oui folder. I tried that as well and it didnt work)
    echo $JAVA_HOME
    /usr/java/jdk1.7.0_02
    So for the heck of it, I tried:
    $ export CLASSPATH=.:${ORACLE_HOME}/jdbc/lib/classes12.zip
    and lo, I am able to at least summon this:
    $ java oracle/apex/APEXExport
    Usage APEXExport -db -user -password -applicationid -workspaceid -instance -skipExportDate -expSavedReports -debug
    -db: Database connect url in JDBC format
    -user: Database username
    -password : Database password
    -applicationid : ID for application to be exported
    -workspaceid : Workspace ID for which all applications to be exported
    -instance : Export all applications
    -skipExportDate : Exclude export date from application export files
    -expSavedReports: Export all user saved intera
    BUT: when invoking specific job, I get this:
    java oracle/apex/APEXExport -db hostname:1521:SID -user apex_030200 -password welcome123 -instance
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
    at oracle.apex.APEXExport.main(APEXExport.java:315)
    any ideas?

    Hello,
    I get a very similar error.
    Windows 7 Ultimate SP1
    Oracle XE 11.2
    Apex 4.1
    jdk 6u31-windows x64.exe (installed to C:\Program Files\Java\jdk1.6.0_31\.....)
    User Variable CLASSPATH = .\; C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc5.jar
    User Variable JAVA_HOME = C:\program files\java\jdk1.6.0_31\jre\bin
    User Variable ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server
    System Variable PATH = C:\oraclexe\app\oracle\product\11.2.0\server\bin;;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\11.0\DLLShared\;C:\Program Files (x86)\Pinnacle\Shared Files\;C:\Program Files (x86)\Pinnacle\Shared Files\Filter\;C:\Program Files (x86)\QuickTime\QTSystem\
    At the C:\apex\utilities directory I give the command:
    java oracle.apex.APEXExpress -db localhost:1521:XE -user SUSANNA -password skippy123 -expworkspace
    I get the error:
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/apex/APEXExpress
    Caused by: java.lang.ClassNotFoundException: oracle.apex.APEXExpress
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doProvileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class: oracle.apex.APEXExpress. Program will exit.

Maybe you are looking for

  • Project Pro 2013 client Deployment with Lync 2010 and Team Explorer Excel Issues Following

    Current machines are Office 2010 SP1 or SP2 32-bit Just deployed Project 2013 Pro and Std to the existing machines that had Project 2010 Pro or Std.  We selected the full install since people use integration into different tools. Results: lync 2010 6

  • CSS Error in running javafx application after move to use jdk8

    Hi all, I'm running an javafx app fine with build: jdk-8-ea-b36e-linux-arm-hflt-29_nov_2012 which uses jdk7 perfectly fine on the raspberry pi (which i also keep as backup until newer builds well, are starting to work with my app). I'm getting an exc

  • How to install archlinux2008.6 from the hard drive?

    How to install archlinux2008_6 by archlinux2008_6_i686.iso in  hard drive? i get the booting files(archlive.img,vmlinuz26) in the archlinux2008_6_i686.iso and put them in c:\ in the grub command mode the use of these code: root   (hd0,0) kernel (hd0,

  • HELP - iTunes crashes when I try to visit the store

    Hi, iTunes quits unexpectedly whenever I attempt to visit the Store. The computer is authorised and all other iTunes features work fine - just crashes whenever I click on store. I've tried reinstalling, recreating my music library etc without any luc

  • Stand-Alone JMS SAF Client

    Im interested in using a WL Stand-Alone JMS SAF Client to send messages to a server-side JMS destination,           regardless of the servers availability.           This is for a J2SE Swing Application. There currently is no app server interaction.