Batch Cannot find the main class GUI

September 6, 2010 at 16:00:10
Specs: Windows 7
When I try to run (as in double click) a run.bat file, I get this error. I have had this error for a while and I'm about to go insane.

Please help me! But don't get too technical.

I want to know to fix this.

See More: Batch Cannot find the main class GUI

Report •

September 6, 2010 at 17:21:39
Make sure you have the Java directory in the "path" variable.

To check, open the command prompt and enter "ECHO %Path%" (No quotes). Look for "C:\Program Files (x86)\jre*Current Version*\bin" Or"C:\Program Files\jre1.6.0_05\bin"

If it's not there you will need to add it.

Can I put a question here?

Report •

September 6, 2010 at 18:39:14
The problem is that I don't have jre installed, now that I have installed it what do I do?

Report •

September 6, 2010 at 19:09:41
Oh man,

Follow what I said above to check if you have it in the path variable,

If it's not there, you can either add it temporarily, or permanently. place this code at the top of your batch file to add it temporarily:

SET path="C:\Program Files\jre*Current Version*\bin";%path%

Or "C:\Program Files (x86)\jre1.6.0_05\bin" if you have a 64-bit operating system.

and to permanently add it:

Right click “My Computer” icon
Choose “Properties” from context menu
Click “Advanced” tab (“Advanced system settings” link in Vista)
Add the directory of JRE to the path seperating it with a semicolon (;)

Can I put a question here?

Report •

Related Solutions

September 7, 2010 at 03:06:55
Ok, I tried everything you said and nothing worked... (I have jre6)
I tried editing the batch file by adding

SET path="C:\Program Files (x86)\Java\jre6\bin";%path%

to the top. I tried changing my PATH variable value to...

C:\Program Files (x86)\Java\jre6\bin;

...(I even made a new variable). I still got the error. I tried changing my CLASSPATH variable value to that as well.

Nothing worked.

(I have a 64-bit operating system)

Report •

September 7, 2010 at 14:00:58
Double check the JRE path. Go into my computer > local disc >Program Files (x86) > and look for the JRE folder. It will be a longer number than just 6 (ie or something like that)

Also check that you have a GUI.class file in your java folder.

Can I put a question here?

Report •

Ask Question