No main method error
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   tracy_tucker
Posted On:   Friday, June 15, 2001 06:55 PM

On intel machine with jdk1.3. A java source file C1.java has code for 4 classes,... C1, C2, C3, C4 javac successfully processes C1.java without warning or deprecation notices regardless of whether C1.java resides on the local C drive or in a directory on the netork. c:> c:java in> javac c:java inC1.java AND c:java in> javac \serverdirectoryC1.java Both of the above complete successfully. However, I have only been able to run the program C1 if its class files reside on the default drive. Example successful situations: If C1 related classes reside in c:java in, the following is successfu   More>>

			
On intel machine with jdk1.3.

A java source file C1.java has code for 4 classes,...

C1, C2, C3, C4

javac successfully processes C1.java without warning or
deprecation notices regardless of whether C1.java resides
on the local C drive or in a directory on the netork.

c:> c:java in> javac c:java inC1.java

AND

c:java in> javac \serverdirectoryC1.java

Both of the above complete successfully.

However, I have only been able to run the program C1 if
its class files reside on the default drive.

Example successful situations:

If C1 related classes reside in c:java in, the following is
successful:

c:> c:windowsjavaw.exe c:java inC1

If

e: is mapped to \acaddirectory

AND

e: contains the C1 class files,

the following is successfull:

e:> c:windowsjavaw.exe C1

However, failure comes with the following conditions:

C1 class files reside in \acadserver

c:> c:windows> javaw.exe \serverdirectoryC1

The error message indicates the main method could not be
found.

class C1 within C1.java contains a main method.

At this point, it seems that success depends on the class
files residing on the default drive.

However, consider the different situation:

One.java contains only one class. If its javac successfully
created class file is placed in \serverdirectory, the
following is successful:

c:> c:windowsjavaw.exe \serverdirectoryOne

Comments? Suggestions?

A little more information about the Classes incurring failure:


The main method of C1 instantiates an instance of itself.
The instanitated object invokes one of its methods. At the
end of that method, a C2 object is instantiated and one of
its methods is invoked. At the end of the method, a C3
object is instantiated and one of its methods is invoked. This
pattern is repeated at the end of C3 relative to C4.


   <<Less
About | Sitemap | Contact