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(ClassLoader.java:621)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        at jmetest.monkeymahjongg.Main.main(Main.java:76)
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:


...
Downloading: http://repo1.maven.org/maven2/jorbis/jorbis/0.0.17/jorbis-0.0.17.pom
[INFO]


[ERROR] BUILD ERROR
[INFO]
[INFO] Failed to resolve artifact.

No versions are present in the repository for the artifact with a range [3.2.0,4.0.0)
  org.eclipse.swt.win32.win32:x86_64:jar:null

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  com.jmonkeyengine (http://www.jmonkeyengine.com/maven/)



:?

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



However the Preferences error remains. No more ideas?



[edit]



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: