JavaVM for UWP (Help needed)

Hey Guys,
I decided to work on a Project called JVM4UWP (Name is subject to change), which brings you the power of java to all UWP (Unified Windows Platform)/WinRT.

The idea is that you can use the jvm.dll and java.dll as you have it in your regular jdk distribution.
You can then compile a native app which launches a vm to execute your code inside.

There only were two problems: Some API has been changed (LoadLibrary doesn’t allow dll’s other than those in system32, so you need LoadPackagedLibrary and package the libraries) and the build was made for Visual Studio 2013, so I had to upgrade some new things (C++14 conventions and stuff).

Now however I’ve reached a dead end where I am hoping that some bored and wise monkeys could help me out. The First issue (which isn’t a priority) is that the build crashes because of some linking issues because for some unknown reason the c runtime is compiled in statically.

The second (which I need your help with) is that for some reason the vm fails to initalize since the classpath isn’t properly used. It fails to load the very first class java/lang/Object, for some reason.

Everything you need to know is written in the Readme file of the repo.

Thanks :slight_smile:


Hey guys,
I made some progress, most issues are actually finding out what Windows RT also fordbids as security feature…

Currently it looks like we’d need to change the way how JME stores settings and/or change the Perferences to nbot behave consistently with other platforms. Not so cool :smiley:

Exception in thread "AWT-EventQueue-0" java.lang.SecurityException: Could not open windows registry node Software\JavaSoft\Prefs at root 0x80000001: Access denied
	at java.util.prefs.WindowsPreferences.openKey(
	at java.util.prefs.WindowsPreferences.openKey(
	at java.util.prefs.WindowsPreferences.<init>(
	at java.util.prefs.WindowsPreferences.childSpi(
	at java.util.prefs.AbstractPreferences.node(
	at java.util.prefs.AbstractPreferences.node(
	at com.jme3.system.AppSettings.load(
	at com.jme3.system.JmeDesktopSystem$
	at java.awt.event.InvocationEvent.dispatch(
	at java.awt.EventQueue.dispatchEventImpl(
	at java.awt.EventQueue.access$500(
	at java.awt.EventQueue$
	at java.awt.EventQueue$
	at Method)
	at java.awt.EventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(

The thing is, even HKEY_CURRENT_USER, which was available for non admin users but now won’t be there anymore.
A workaround seems to be -Djava.util.prefs.PreferenceFactory=java.util.prefs.FileSystemPerferenceFactory, but I guess the FS Factory also needs an overhaul (AppData instead of ~/.java).

Now the problem is that the FileSystemPreferences are Unix only so I need to find out whether the platform specific chmod and file locking works on Windows (Visual Studio’s libc does a good job in adding posix compatible wrapper functions actually)


This is how I did:

String folderName="myJMEGame";
            defPath = "~/." + folderName + "/";
            if (System.getProperty("").startsWith("Windows")) {
                defPath = Shell32Util.getKnownFolderPath(KnownFolders.FOLDERID_SavedGames) + "/" + folderName + "/";
            File userSettings = new File(defPath + fileName + ".properties");
            File f = new File(defPath);
            if (!userSettings.exists()) {

I think you need JNA for Shell32.