JDK-8369741 : cannot use java.security inside of UWP apps
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 25
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: x86_64
  • Submitted: 2025-10-11
  • Updated: 2025-10-14
  • Resolved: 2025-10-14
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
Windows 24H2 (26100.6725)

A DESCRIPTION OF THE PROBLEM :
This is already mentioned in JDK-8352728, however that one is related to installation locations, whilst UWP apps are installed in a location controlled by the operating system.

UWP apps are running in a Sandbox which prevents them from accessing anything but their own whitelisted directories, this includes the application directory, including the runtime created with jlink, this causes Java to fail when loading the built-in java.security file

REGRESSION : Last worked in version 23

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- package your app using jpackage
- register it as an AppX app (Register-AppXPackage -Register <path>
- open it

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Everything works
ACTUAL -
Exception in thread "AWT-EventQueue-0" java.lang.InternalError: Error loading java.security file
        at java.base/java.security.Security$SecPropLoader.loadMaster(Unknown Source)
        at java.base/java.security.Security$SecPropLoader.loadAll(Unknown Source)
        at java.base/java.security.Security.initialize(Unknown Source)
        at java.base/java.security.Security.<clinit>(Unknown Source)
        at okhttp3.internal.platform.PlatformRegistry.findPlatform(PlatformRegistry.kt:1023)
        at okhttp3.internal.platform.Platform$Companion.access$findPlatform(Platform.kt:1223)
        at okhttp3.internal.platform.Platform.<clinit>(Platform.kt:203)
        at okhttp3.OkHttpClient.<init>(OkHttpClient.kt:300)
        at okhttp3.OkHttpClient$Builder.build(OkHttpClient.kt:1384)
        at io.ktor.client.engine.okhttp.OkHttpEngine.okHttpClientPrototype_delegate$lambda$5(OkHttpEngine.kt:140)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:86)
        at io.ktor.client.engine.okhttp.OkHttpEngine.access$createOkHttpClient(OkHttpEngine.kt:5139)
        at io.ktor.client.engine.okhttp.OkHttpEngine$clientCache$1.invoke(OkHttpEngine.kt:1041)
        at io.ktor.util.LRUCache.get(Cache.kt:53)
        at java.base/java.util.Collections$SynchronizedMap.get(Unknown Source)
        at io.ktor.client.engine.okhttp.OkHttpEngine.execute(OkHttpEngine.kt:64)
        at io.ktor.client.engine.HttpClientEngine$executeWithinCallContext$2.invokeSuspend(HttpClientEngine.kt:183)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:124)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:1820)
        Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.scene.ComposeContainer$DesktopCoroutineExceptionHandler@44e60709, androidx.compose.runtime.BroadcastFrameClock@59f8973b, StandaloneCoroutine{Cancelling}@46c3bbdb, FlushCoroutineDispatcher@36c81a4d]
Caused by: java.nio.file.AccessDeniedException: C:\Users\micha\IdeaProjects\tonbrett\app\desktop\build\msix-workspace\runtime\conf\security\java.security
        at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsLinkSupport.getRealPath(Unknown Source)
        at java.base/sun.nio.fs.WindowsPath.toRealPath(Unknown Source)
        at java.base/sun.nio.fs.WindowsPath.toRealPath(Unknown Source)
        at java.base/java.security.Security$SecPropLoader.loadFromPath(Unknown Source)
        ... 23 more

---------- BEGIN SOURCE ----------
Security.getProviders()
---------- END SOURCE ----------


Comments
Requested a simple reproducer from the submitter.
13-10-2025