Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem starting java program -> "Could not find the main class. Program will exit!"

67 views
Skip to first unread message

Stefan Röhle

unread,
Sep 25, 2003, 3:43:54 AM9/25/03
to
Hi,

I got a very annoying problem which I cannot discuss here at length...
One aspect is that I need to run the InControl software from VXL, which
is written in java.

The batch file for starting the program contains the following lines:

@ECHO OFF
Path =
C:
cd C:\Programme\inControl\classes\
start/b javaw incontrol.Vxl_Ic_Incontrol
..\test_configuration\systemproperty.txt

(last line wrapped due to email program)

When executing the batch file I always get the error message mentioned
in the subject.
(Java version 1.4.1_03)

What could be the possible problems?

Stefan Röhle

Erwin Moller

unread,
Sep 25, 2003, 8:01:16 AM9/25/03
to
Stefan Röhle wrote:

> Hi,
>
> I got a very annoying problem which I cannot discuss here at length...
> One aspect is that I need to run the InControl software from VXL, which
> is written in java.
>
> The batch file for starting the program contains the following lines:
>
> @ECHO OFF
> Path =
> C:
> cd C:\Programme\inControl\classes\
> start/b javaw incontrol.Vxl_Ic_Incontrol
> ..\test_configuration\systemproperty.txt
>
> (last line wrapped due to email program)

Hi,

Which javaclass are you executing?
Maybe I read you lines wrong, in that case sorry, but normally you would
have something like:
javaw YourProgram

In your case I read:
javaw incontrol\classes\..etc..\systemproperty.txt

and I don't expect systemproperty.txt to be a compiled javaclass with
main-method.

It is however possible that your linewrapping messed the posting up.
In that case incontrol.Vxl_Ic_Incontrol is your javaclass, and the rest is
an argument to the class.

Does that help?

Regards,
Erwin Moller

Michael Ruf

unread,
Sep 25, 2003, 8:10:45 AM9/25/03
to
Hi,

Stefan Röhle schrieb:


>
> @ECHO OFF
> Path =
> C:
> cd C:\Programme\inControl\classes\
> start/b javaw incontrol.Vxl_Ic_Incontrol
> ..\test_configuration\systemproperty.txt
>
> (last line wrapped due to email program)
>
>

> What could be the possible problems?
>

Java can't find the main class, you should add it to your classpath.
Try this ( Sets the classpath to the current directory ):

start/b javaw -cp . incontrol.Vxl_Ic_Incontrol
..\test_configuration\systemproperty.txt

regards
Michael

Stefan Röhle

unread,
Sep 25, 2003, 9:34:18 AM9/25/03
to
The problem was that the environment variable PATH was not set to the
correct java location. Adding the full path to javaw.exe was the solution.

Stefan

0 new messages