Java Problem?

LaRoni

New member
After installing an update to java, I can't run any jar files. I now get a message 'Could not find the main class. Program will exit.' I tried a full uninstall of java and reinstall (a couple times but it's still not working. Anyone know why or how to fix it?
 
After installing an update to java, I can't run any jar files. I now get a message 'Could not find the main class. Program will exit.' I tried a full uninstall of java and reinstall (a couple times but it's still not working. Anyone know why or how to fix it?

I'm having a similar problem except there's no error message and my browser stops responding until I force Java to stop running. My best guess is that while mafia is J2SE 1.4 compliant it's not compliant with 1.6 (the current version). Unfortunately I can't figure out where to get 1.4 again (can't get it to download from Sun Micro systems) and wouldn't know how to make it use 1.4 instead of 1.6 if I could.

Edit: wow not sure where I got that 1.6. Might have something to do with the five hours of sleep a night I've been running on. I'm running what they identify as version 6 update 18.
 
Last edited:
Attempting to solve the problem by using a registry booster program. So far it's found 150 errors. I'll report back after rebooting and trying mafia again.

Edit: The registry booster needed an upgrade to it's newest version so it will be a few minutes while I run it again to make sure it doesn't find any new errors. the first time it ran it did find what it described as a "Third party related error - errors affecting programs installed on your PC" so I hope I'll be able to run mafia correctly once I'm done.


Crossing my fingers. Here we go . . .


Well it looks like it's trying a little harder this time.

It's been three minutes. I think I can safely say mafia isn't going to load. However I'm not having the problem where firefox stops responding either so I'll let java continue to run and see what happens.

Is everyone who's having this problem running win 7 and java 6 update 18? Are you also running it on a netbook?

Is anyone running win 7 and java 6 update 18 who CAN run mafia?

Maybe by comparing computer specs we can figure out if it's a memory issue or something.


My attempts to make it work so far:

1: Clean reinstall of Java
2: Clean reinstall of Mafia
3: Attempted to downgrade Java and discovered they claim no prior version will work with win 7.
4: Disabled firewalls in case they were blocking mafia (Did not help. Re-enabled the one I wanted running for safety. Left windows native firewall off since running two at once can cause problems).
5: ran a registry booster

Any other ideas? I'd post an error log but mafia isn't generating one.

It is however generating blank session logs if that helps diagnose the issue.

Another update: Hadn't noticed this in the past but on my task bar it's showing an icon "Main Interface (redwulfsmulti)" but instead of displaying the main interface it's showing the Java coffee cup icon.
 
Last edited:

fronobulax

Developer
Staff member
FWIW, I am having no problems with Windows 7, 64 bit. However, when I ask what version is being used I get
C:\Users\Fronobulax>java -version
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) 64-Bit Server VM (build 14.0-b16, mixed mode)
which is older than what you seem to be having trouble with.

I cannot convince the java updater that there is a version 18 available for my system, although I do not doubt that 18 is the latest, and recommended version.

Since I have the SE Development kit on this system (version 14) it is almost certain that everything I run is using that version.

For the record I also managed to check in code that would compile on my system but not those of several people who built mafia from source so what works on my system is suspect. That said, I don't see any language features introduced with version 18 that would break anything that was previously working.

You might also tell us a) how you are trying to run the jar file and b) whether you can run any jar file at all?

From a command prompt, in an appropriate directory and with the appropriate path set I run with
java -jar "name_of_the_jar_file"

I do this because some time in the past Windows file associations got hosed and making a batch file with that command was easier than reestablishing the association.
 
You might also tell us a) how you are trying to run the jar file and

By double clicking on it. I'm having issues with the exe as well as the jar.

b) whether you can run any jar file at all?

The only jar files I use are mafia. I'll try to look up some others and find out. I do know that it apears to be a java problem because when I go to java's web page and try to test my java virtual machine it buggers up in a similar manner.
 
Last edited:

fronobulax

Developer
Staff member
You might try opening a command line, navigating to the directory where the jar file is and trying
Code:
java -jar "name_of_the_jar_file"
to run things. Not sure it will work but worth a try.

While the command line is open, also try
Code:
java -version
just to confirm that you are running the latest update.

Finally, it might be worth opening Control Panel and the Add/Remove equivalent for Windows 7 (which I forget at the moment) and seeing just which Java versions are installed.

And since someone over on the main game forums mentioned netbooks I hope you have an appropriate amount of memory.

Based up what you have said so far, I'm pointing a finger at Java, not mafia, although that still doesn't help get you up and running.
 
You might try opening a command line, navigating to the directory where the jar file is and trying
Code:
java -jar "name_of_the_jar_file"
to run things. Not sure it will work but worth a try.

While the command line is open, also try
Code:
java -version
just to confirm that you are running the latest update.

Finally, it might be worth opening Control Panel and the Add/Remove equivalent for Windows 7 (which I forget at the moment) and seeing just which Java versions are installed.

And since someone over on the main game forums mentioned netbooks I hope you have an appropriate amount of memory.

Based up what you have said so far, I'm pointing a finger at Java, not mafia, although that still doesn't help get you up and running.

None of that worked unfortunately. The netbook is running 1 gig of ram which is supposed to be more than enough for windows 7. It does look to be upgradeable and I might try that when I have the funds. Even if it doesn't solve the problem more ram is rarely a bad thing.
 

fronobulax

Developer
Staff member
None of that worked unfortunately.
If "none of that worked" includes just opening a command line and doing java -version then I would throw up my hands in despair. I would then back up my system. I would then uninstall any Java that the Control Panel says is installed. When that is done I would root around in Program Files (both types if 64 bit) and my User directory looking for directories that Java might have created and delete them. I would then repeatedly run my registry cleaner of choice (I'm partial to CCleaner myself) until it found nothing to delete. I would go into the Computer's Properties and delete any Java related environmental entries including portions of the PATH and variables such as Java_Home. I would reboot, repeat the registry exercise and then install whatever the latest version of Java is. This could solve the problem and it certainly would make me think I had done something.

Alternatively, if the java -version is not working then it is quite likely that the path is wrong or got hosed with the upgrade. So a less drastic diagnostic would be to adjust the path until java -version worked and then see what happens with java -jar "file_name" does.
 
If "none of that worked" includes just opening a command line and doing java -version then I would throw up my hands in despair.

Java -version "worked" in that it displayed the appropriate information. It didn't work in that none of it fixed my issues. I may try your more drastic solution when I have more time, unfortunately I'm about to leave for work. Thanks for your help.
 

lostcalpolydude

Developer
Staff member
Java -version "worked" in that it displayed the appropriate information. It didn't work in that none of it fixed my issues.

That was the expected result. He was trying to figure out what's up with your setup before giving more info about what you could do to fix it. Since java -version does exactly what it should do, none of the rest of what he posted is likely to be relevant to fixing your setup.
 

fronobulax

Developer
Staff member
That was the expected result. He was trying to figure out what's up with your setup before giving more info about what you could do to fix it. Since java -version does exactly what it should do, none of the rest of what he posted is likely to be relevant to fixing your setup.

Yep. If java -version returns something related to version 6, revision 18 or however it is being labeled, that suggests to me that Java may be properly installed.

At this point, I would consider finding some software that is packaged as a jar file and seeing if it can be successfully launched by double clicking on it. That might cut down where to look for your problem. I'd look at Java demos from Sun as candidates. I won't make a specific suggestion at this point since I can't run it myself at the moment and don't want you to try something of my choice and have it do nasty things.
 
Yep. If java -version returns something related to version 6, revision 18 or however it is being labeled, that suggests to me that Java may be properly installed.

At this point, I would consider finding some software that is packaged as a jar file and seeing if it can be successfully launched by double clicking on it. That might cut down where to look for your problem. I'd look at Java demos from Sun as candidates. I won't make a specific suggestion at this point since I can't run it myself at the moment and don't want you to try something of my choice and have it do nasty things.

The only files I was able to find were here http://java.sun.com/applets/jdk/1.4/index.html and didn't seem downloadable (or at least they didn't download as jar files when I tried). They did work in browser though. This is highly frustrating.
 

fronobulax

Developer
Staff member
The only files I was able to find were here http://java.sun.com/applets/jdk/1.4/index.html and didn't seem downloadable (or at least they didn't download as jar files when I tried). They did work in browser though. This is highly frustrating.
Robocode is a fairly interesting application in and of itself, but the installer is available at SourceForge as a jar file. It is a large file for a quick test but you could DL it and start the install. If you get to the point where it asks you what directory to install in then you have demonstrated there is at least one jar file that can be launched from your configuration and (much to our surprise) the finger swings back towards mafia. If you can't run it then it pretty much points the finger at your configuration or the v18 update.

I just DL'd the file to the desktop and then double clicked on it to launch. Obviously, I personally am willing to trust a jar file from SourceForge, especially after it passes a virus scan.
 

Raven434

Member
Use the 32-bit version of Java.

I have 64-bit Vista and had *huge* problems with 64-bit Java and Mafia.

The machine does "way less stupid shit" when I use the 32-bit version.

Not a good technical explanation, more an observation.
 
Last edited:
Use the 32-bit version of Java.

I have 64-bit Vista and had *huge* problems with 64-bit Java and Mafia.

The machine does "way less stupid shit" when I use the 32-bit version.

Not a good technical explanation, more an observation.


I believe I am using the 32 bit version. Is there any way to double check?
 
Robocode is a fairly interesting application in and of itself, but the installer is available at SourceForge as a jar file. It is a large file for a quick test but you could DL it and start the install. If you get to the point where it asks you what directory to install in then you have demonstrated there is at least one jar file that can be launched from your configuration and (much to our surprise) the finger swings back towards mafia. If you can't run it then it pretty much points the finger at your configuration or the v18 update.
I just DL'd the file to the desktop and then double clicked on it to launch. Obviously, I personally am willing to trust a jar file from SourceForge, especially after it passes a virus scan.

It downloaded and installed in a flash. And now it seems to run correctly. I have one idea I'm going to try but I'm not sure it will work . . .


I deleted all mafia files from both profiles on the computer. Did a search and found some hiding and deleted them too. I ran CC Cleaner and found some errors on my wife's profile and fixed them. Then I ran Uniblue's registry booster and found more errors on her profile and fixed those as well. I did the same on my profile. Then I tried to download the latest daily build and it still doesn't work. I did eventually figure out how to get older versions of java and they don't work either. What are mafias precise system requirements? I don't recall seeing them listed and I'd like to double check that the computer meets them (even though I'm sure mafia ran on it previously).


Edit: Interesting. It turns out that this attempt is the first that generated a session log that wasn't blank. It looks like it actually ran through breakfast but the interface never came up. Trying to log on to the relay browser to see if I can get that to work.
 
Last edited:

Raven434

Member
I believe I am using the 32 bit version. Is there any way to double check?

>java -version

In my case I get:

java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

I am running 64-bit Vista with SP2.
 

LaRoni

New member
I've tried everything I can think of and what was suggested. Uninstall, reinstall, registry cleaners, going through directories manually and getting rid of anything that looks java related. Just not working and I haven't a clue as to why. I'm running Vista as well so it doesn't seem to be OS specific.
 
Top