Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I write System preferences with Java? Can I invoke UAC?
    primarykey
    data
    text
    <p>How can I write system preferences with Java, using <a href="http://java.sun.com/javase/6/docs/api/java/util/prefs/Preferences.html#systemRoot()" rel="nofollow noreferrer"><code>Preferences.systemRoot()</code></a>?</p> <p>I tried with:</p> <pre><code>Preferences preferences = Preferences.systemRoot(); preferences.put("/myapplication/databasepath", pathToDatabase); </code></pre> <p>But I got this error message:</p> <pre><code>2010-maj-29 19:02:50 java.util.prefs.WindowsPreferences openKey VARNING: Could not open windows registry node Software\JavaSoft\Prefs at root 0x80000002. Windows RegOpenKey(...) returned error code 5. Exception in thread "AWT-EventQueue-0" java.lang.SecurityException: Could not open windows registry node Software\JavaSoft\Prefs at root 0x80000002: Access denied at java.util.prefs.WindowsPreferences.openKey(Unknown Source) at java.util.prefs.WindowsPreferences.openKey(Unknown Source) at java.util.prefs.WindowsPreferences.openKey(Unknown Source) at java.util.prefs.WindowsPreferences.putSpi(Unknown Source) at java.util.prefs.AbstractPreferences.put(Unknown Source) at org.example.install.Setup$2.actionPerformed(Setup.java:43) </code></pre> <p>I would like to do this, because I want to install an embedded JavaDB database, and let multiple users on the computer to use the same database with the application.</p> <p>How to solve this? Can I invoke UAC and do this as Administrator from Java? And if I log in as Administrator when writing, can I read the values with my Java application if I'm logged in as a User?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload