PreferencesGameSettings and Vista

Trying this in Vista (64 bit Home Premium):

preferences = Preferences.userNodeForPackage(Main.class);
gameSettings = new PreferencesGameSettings(preferences);
standardGame = new StandardGame("Monkey Mahjongg", StandardGame.GameType.GRAPHICAL, gameSettings);

gives that:

WARNUNG: Could not open/create prefs root node SoftwareJavaSoftPrefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file com/jmex/game/StandardGame
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClassInternal(
        at jmetest.monkeymahjongg.Main.main(
Java Result: 1

Any ideas???

What are you trying to put into your preferences?  It would appear you're trying to put something in that it doesn't think can be serialized into the registry.

Error code 5 means "Access Denied"… It's strange though that Java writes to the illegal registry locations. Are you using the 64bit version of JRE?

The second error seems to be caused by an incomplete compilation, do a "Clean and Build" in your IDE so all files are properly compiled.

The three lines of code are the very first things I do in the main method. The error occurs in the third line, which is line# 76.

I checked the Java version, too:

java version "1.6.0_10-beta"
Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b12, mixed mode)

I also tried to update and rebuild JME2, but run into trouble:


[INFO] Failed to resolve artifact.

No versions are present in the repository for the artifact with a range [3.2.0,4.0.0)

from the specified remote repositories:
  central (,
  com.jmonkeyengine (


I can compile with maven only when changing x86_64 -> x86 in the POM.

However the Preferences error remains. No more ideas?


OK, I came to a full stop now. I get an error even when using PropertiesGameSettings. And worse, I get another error when calling StandardGame without game settings at all. And even more worserer, I just found out that lwjgl doesn't seem to support 64 bit Vista yet. Bleh!  :expressionless:

So I have a good excuse to delay the monkeymahjongg update

Do what I do in Vista 64…run a 32-bit VM.  :stuck_out_tongue:

Hey, better than nothing! Thanks for the tip, I didn't think about this!  :smiley: