A newbie needs help... Quick!!

I have 2 java applications, one runs, 1 doesn't. This is a copy of the one that runs.
public class Welcome1 {
public static void main( String args[] )
{
System.out.println( "Welcome to Java Programming!" );
}
}
Output:
Welcome to Java Programming!
Press any key to continue . . .

This is a copy of the one that doesn't:
public class Welcome2 {
public static void main( String args [] )
{
System.out.print("Welcome to ");
System.out.println("JavaProgramming!");
}
}
output:
Exception in thread "main" java.lang.NoClassDefFoundError: Welcome2
Press any key to continue . . .

My path is:c:Windows;cWindowscommand;c:j2sdk1.4.0_01in
My classpath is :C:j2sdk1.4.0_01in
These paths I got from Control Panel| System| Advanced| Environment Variables

My os is: Windows XP professional
Thanks for any help that you can give to me. I am going crazy trying to figure this out

Comments

  • : I have 2 java applications, one runs, 1 doesn't. This is a copy of the one that runs.
    : public class Welcome1 {
    : public static void main( String args[] )
    : {
    : System.out.println( "Welcome to Java Programming!" );
    : }
    : }
    : Output:
    : Welcome to Java Programming!
    : Press any key to continue . . .
    :
    : This is a copy of the one that doesn't:
    : public class Welcome2 {
    : public static void main( String args [] )
    : {
    : System.out.print("Welcome to ");
    : System.out.println("JavaProgramming!");
    : }
    : }
    : output:
    : Exception in thread "main" java.lang.NoClassDefFoundError: Welcome2
    : Press any key to continue . . .
    :
    : My path is:c:Windows;cWindowscommand;c:j2sdk1.4.0_01in
    : My classpath is :C:j2sdk1.4.0_01in
    : These paths I got from Control Panel| System| Advanced| Environment Variables
    :
    : My os is: Windows XP professional
    : Thanks for any help that you can give to me. I am going crazy trying to figure this out
    :


    Set your CLASSPATH=.;C:j2sdk1.4.0_01in (including the dot at the beggining... its to tell the compiler to include the actual directory)
  • [b][red]This message was edited by bytes4me at 2002-8-31 19:36:1[/red][/b][hr]
    : : I have 2 java applications, one runs, 1 doesn't. This is a copy of the one that runs.
    : : public class Welcome1 {
    : : public static void main( String args[] )
    : : {
    : : System.out.println( "Welcome to Java Programming!" );
    : : }
    : : }
    : : Output:
    : : Welcome to Java Programming!
    : : Press any key to continue . . .
    : :
    : : This is a copy of the one that doesn't:
    : : public class Welcome2 {
    : : public static void main( String args [] )
    : : {
    : : System.out.print("Welcome to ");
    : : System.out.println("JavaProgramming!");
    : : }
    : : }
    : : output:
    : : Exception in thread "main" java.lang.NoClassDefFoundError: Welcome2
    : : Press any key to continue . . .
    : :
    : : My path is:c:Windows;cWindowscommand;c:j2sdk1.4.0_01in
    : : My classpath is :C:j2sdk1.4.0_01in
    : : These paths I got from Control Panel| System| Advanced| Environment Variables
    : :
    : : My os is: Windows XP professional
    : : Thanks for any help that you can give to me. I am going crazy trying to figure this out
    : :
    :
    :
    : Set your CLASSPATH=.;C:j2sdk1.4.0_01in (including the dot at the beggining... its to tell the compiler to include the actual directory)
    :

    THANKS a million!! I have been going crazy!!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories