"Could not find the main class. Program will exit."

Having trouble running a class...

Java file looks like this:

-

package samples.call;

import samples.call.Account;

import javax.swing.*;

public class TestAccount3 {

public static void main(String[] args){

//Do stuff

)

)

class resides in c:\renew\renew2, which is included in my environment variable CLASSPATH. Account.class is located in c:\renew\renew2\samples\call, and both can compile.

When I go to cmd prompt, and navigate to c:\renew\renew2, and type in

java TestAccount3

I get

Exception in thread "main" java.lang.NoClassDefFoundError: TestAccount3 (wrong n

ame: samples/call/TestAccount3)

When I type

javaw TestAccount3

I get a window labeled Java Virtual Machine, with the message "Could not find the main class. Program will exit."

Anyone have suggestions? Thank you.

[904 byte] By [willies777a] at [2007-10-3 2:47:58]
# 1
maybe its a classpath error.try compiling with "java -cp . Program"
TuringPesta at 2007-7-14 20:36:45 > top of Java-index,Java Essentials,Java Programming...
# 2
To start you have to use the full qualified class name (package and class name):java samples.call.TestAccount3
D_Daniela at 2007-7-14 20:36:45 > top of Java-index,Java Essentials,Java Programming...