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

Could not find the main class. Program will exit.

1,073 views
Skip to first unread message

xsrossiter

unread,
Jan 30, 2010, 2:58:32 AM1/30/10
to

Hello everyone,

I hope you developers won't mind this non-programming question but I
am not sure where else to turn for a broken Java installation problem.
Google searches bring me here to these forums, hopefully someone can
help me fix this situation.

Recently Java Updater attempted to upgrade my installation from Java
to 6.17 to 6.18. I stopped it halway through the upgrade because it
needed to shutdown a running program and I did not want to loose any
of the work I had within the program. I eventually finished what I was
doing, terminated the program and restarted my computer at which time
Java said it would complete the upgrade. Everything seemed to work
fine but the problems began when I went to Settings -> Contol Panel ->
Java and instead of the Java Control Panel appearing the following
dialog box appeared with "Java Virtual Machine Launcher" in the Title
Bar and an error message of "Could not find the main class. Program
will exit."

I have uninstalled and reinstalled various versions of Java 6 with no
luck. Version 5.xx brings up a working Control Panel but some of my
software needs version 6.15 at least. I have run a few registry
cleaners as well as Microsoft's Windows Installer CleanUp Utility to
catch broken associations, etc but nothing has worked yet to get a
normal installation of 6.18 with working Java Control Panel. In
addition I tried various Restore Points but whenever I tried to bring
the version of Jave to a 6.xx level the error message would reappper
and the Java software quit working, although Windows Task Manager does
show javaw.exe running when I attempt to start a Java program,
otherwise there is just jqs.exe and jusched.exe running in the
backgraound.

I am running XP SP3 and Firefox 3.6. The Java Verification Page
( http://java.com/en/download/installed.jsp ) properly detects Java
6.18 on my computer but the "How do I test whether Java is working on
my computer?" site ( http://java.com/en/download/help/testvm.xml )
does not properly run the applet (just a black rectangle appears),
this after clearing my browser cache.

Finally, I went through this guide ( http://mindprod.com/jgloss/jdk.html#FAILED
) Wassup worked fine but everything else mentioned above did not.

The Tools -> Java Console selection in Firefox brings up no console
but the Error Console has a messages, two of them below:

Error: [Exception... "'JavaScript component does not have a method
named: "onLocationChange"' when calling method:
[nsIWebProgressListener::onLocationChange]" nsresult: "0x80570030
(NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame ::
file:///C:/Program%20Files/Mozilla%20Firefox/components/nsBrowserContentHandler.js
:: openWindow :: line 167" data: no]
Source File: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsBrowserContentHandler.js
L

Error: uncaught exception: [Exception... "Component returned failure
code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.clearUserPref]"
nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame ::
chrome://dotnetassistant/content/bootstrap.js ::
BootStrapDotNetAsssitantExtension :: line 52" data: no]


Thanks, Steve

KB

unread,
Jan 30, 2010, 9:45:21 AM1/30/10
to
I had a similar problem, and this fixed it:

http://support.microsoft.com/kb/831430

Lew

unread,
Jan 30, 2010, 11:14:02 AM1/30/10
to
KB wrote:
> I had a similar problem, and this fixed it:
>
> http://support.microsoft.com/kb/831430

That article has absolutely nothing to do with Java that I can see; it's about
installation of the Jscript.dll.

--
Lew

Knute Johnson

unread,
Jan 30, 2010, 11:49:34 AM1/30/10
to
I had a similar problem and the only way I could fix it was to use the
Add/Remove Programs and delete all the Javas on my machine. Go to
C:\Program Files\Java\ and delete all the jre and jdk directories. Then
if there are any Javas shown still in the Add/Remove Programs, reinstall
and delete again. Then install the one you want.

--

Knute Johnson
email s/nospam/knute2010/

markspace

unread,
Jan 30, 2010, 12:58:03 PM1/30/10
to
Knute Johnson wrote:
> I had a similar problem and the only way I could fix it was to use the
> Add/Remove Programs and delete all the Javas on my machine. Go to
> C:\Program Files\Java\ and delete all the jre and jdk directories. Then
> if there are any Javas shown still in the Add/Remove Programs, reinstall
> and delete again.


At this point the OP might want to run his registry cleaner, just to
make sure.


> Then install the one[(s)] you want.
>

Having both Java 5 and Java 6 is often a good idea, consider getting
both. Just 6 however will probably suffice for testing the OPs current
issue.


Knute Johnson

unread,
Jan 30, 2010, 1:00:30 PM1/30/10
to

I'm curious on a Windows system how you use two JDKs or JREs on the same
computer?

markspace

unread,
Jan 30, 2010, 1:15:53 PM1/30/10
to
Knute Johnson wrote:

> I'm curious on a Windows system how you use two JDKs or JREs on the same
> computer?


First, Sun designs their installer and JRE/JDKs to co-exist peacefully,
so it doesn't happen on accident. I only use the auto-update mechanism
from Sun, and my Program Files/Java directory looks like this:

Brenden@Homer /cygdrive/c/Program Files/Java
$ ls
jdk1.5.0_12 jdk1.6.0_17 jre1.6.0 jre1.6.0_03 jre1.6.0_07
jdk1.5.0_22 jre1.5.0_12 jre1.6.0_01 jre1.6.0_04 jre1.6.0_16
jdk1.6.0 jre1.5.0_22 jre1.6.0_02 jre1.6.0_05 jre6

(I'm running Cygwin, btw.)

In NetBeans, there's a little drop down that lets you choose your target
environment. I can switch between 1.5 and 1.6 on my copy of NetBeans.
This requires the runtimes be available, which is why I need both.

For deploying applications, you can specify Specification-Version in the
manifest to set the minimum compatible version of JRE required. I think
at least for applets, you can set the maximum version too, allowing to
to specify that only 1.5 would be used even if 1.6 is available, for
example.

For the latter reason, the OP may need both JREs on his system.


Lew

unread,
Jan 30, 2010, 3:05:16 PM1/30/10
to
Knute Johnson wrote:
>> I'm curious on a Windows system how you use two JDKs or JREs on the
>> same computer?

Essentially the same way as on any other platform - you install them into
different directories.

markspace wrote:
> First, Sun designs their installer and JRE/JDKs to co-exist peacefully,
> so it doesn't happen on accident. I only use the auto-update mechanism

Tell each installation a different directory for its Java.

It is probably best to install them in version order, save that you would want
to install your preferred version last.

> from Sun, and my Program Files/Java directory looks like this:
>
> Brenden@Homer /cygdrive/c/Program Files/Java
> $ ls
> jdk1.5.0_12 jdk1.6.0_17 jre1.6.0 jre1.6.0_03 jre1.6.0_07
> jdk1.5.0_22 jre1.5.0_12 jre1.6.0_01 jre1.6.0_04 jre1.6.0_16
> jdk1.6.0 jre1.5.0_22 jre1.6.0_02 jre1.6.0_05 jre6
>
> (I'm running Cygwin, btw.)

However, the technique is a Windows technique, not a Cygwin technique.

> In NetBeans, there's a little drop down that lets you choose your target
> environment. I can switch between 1.5 and 1.6 on my copy of NetBeans.
> This requires the runtimes be available, which is why I need both.

Eclipse has a JRE platforms option in its preferences dialog that serves the
same purpose.

In both IDEs, each project can target a different platform.

> For deploying applications, you can specify Specification-Version in the
> manifest to set the minimum compatible version of JRE required. I think
> at least for applets, you can set the maximum version too, allowing to
> to specify that only 1.5 would be used even if 1.6 is available, for
> example.
>
> For the latter reason, the OP may need both JREs on his system.

--
Lew

markspace

unread,
Jan 30, 2010, 1:42:22 PM1/30/10
to
markspace wrote:

> For deploying applications, you can specify Specification-Version in the
> manifest to set the minimum compatible version of JRE required. I think


Which looks wrong. I was thinking of the JNLP spec, which allows one to
specify j2se version ranges. Oh well, that's what I get for posting
before breakfast and coffee.

Roedy Green

unread,
Feb 1, 2010, 7:42:04 AM2/1/10
to
On Sat, 30 Jan 2010 09:58:03 -0800, markspace <nos...@nowhere.com>
wrote, quoted or indirectly quoted someone who said :

>
>At this point the OP might want to run his registry cleaner, just to
>make sure.

See http://mindprod.com/jgloss/jdk.html#TESTING
and
http://mindprod.com/jgloss/jdk.html#FAILED

for more similar hints on getting your JDK/JRE working properly.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Computers are useless. They can only give you answers.
~ Pablo Picasso (born: 1881-10-25 died: 1973-04-08 at age: 91)

Roedy Green

unread,
Feb 1, 2010, 7:43:11 AM2/1/10
to
On Sat, 30 Jan 2010 10:00:30 -0800, Knute Johnson
<nos...@rabbitbrush.frazmtn.com> wrote, quoted or indirectly quoted
someone who said :

>I'm curious on a Windows system how you use two JDKs or JREs on the same
>computer?

see http://mindprod.com/jgloss/multiplejdks.html

Knute Johnson

unread,
Jan 30, 2010, 4:15:10 PM1/30/10
to

If you install them in the normal manner, only the last one is set up in
the path and registry. If you don't use an IDE how do you get at the
version you want? Do you just specify the path to the compiler or
runtime programs?

Thanks,

Knute Johnson

unread,
Jan 30, 2010, 4:14:08 PM1/30/10
to
On 1/30/2010 12:05 PM, Lew wrote:

If you install them in the normal manner, only the last one is set up in

the path and registry. If you don't use an IDE how do you get at the
version you want? Do you just specify the path to the compiler or
runtime programs?

Thanks,

--

Knute Johnson
email s/nospam/knute2010/

Lew

unread,
Feb 5, 2010, 8:46:56 PM2/5/10
to
Knute Johnson wrote:
> If you install them [multiple JREs] in the normal manner, only the last one
> is set up in the path and registry. If you don't use an IDE how do you get
> at the version you want? Do you just specify the path to the compiler or
> runtime programs?

There are various ways. Many programs such as Ant will honor the JAVA_HOME
environment variable. I find it best to ensure that JAVA_HOME and the PATH
are consistent.

That doesn't mean they cannot change. You can override them together by
reassigning them in a startup script, or by command-line options, depending on
the program being invoked.

Some Linuces have an "alternatives" mechanism that manages sym links to make
it easy to change entire environments around, such as coordinating JAVA_HOME
and PATH changes.

You can always override these variables by hand from the command line.

Java tools in particular have some specialized options, like "-bootclasspath"
to help find the right JRE.

IDEs aren't the only Java programs to permit configuration of the JRE under
which they run, and JREs they assign to managed processes.

--
Lew

0 new messages