What causes java.lang.InternalError: platform encoding not initialized ?

Kevin Rushforth kevin.rushforth at oracle.com
Mon Sep 20 22:09:29 UTC 2021


> I've made an
> application image with jpackage.  I've moved the default location of the
> runtime in the application image
> ...
> If I keep the runtime in $APPDIR\runtime, things don't fail in this way.

If it works when using the default location of the Java runtime and no 
other changes, I'd guess that this is a bug in the jpackage app 
launcher, or maybe in the code that creates the runtime (e.g., if 
something isn't copied to the right place when not in the default 
location). Hopefully Andy or Alexey can comment.

-- Kevin


On 9/20/2021 2:37 PM, Scott Palmer wrote:
> This is likely not the right place to ask this (sorry).. but I'm trying to
> get info to write a bug report and want to make sure I'm not doing
> something stupid first.
>
> I've created a JRE image from JDK 17 with jlink.  I've made an
> application image with jpackage.  I've moved the default location of the
> runtime in the application image and modified the launcher .cfg file
> accordingly by adding a line to the [Application] section
>
> app.runtime=$APPDIR\..\my_own_folder\where_the_jre_is_deeper\jre
>
> My application launches.  It shows a JavaFX GUI.  It does a bunch of stuff
> that "works", but then one thread fails with this exception:
>
> Exception in thread "Reader-BG-1" java.lang.InternalError: platform
> encoding not initialized
>          at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native
> Method)
>          at
> java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:933)
>          at
> java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1519)
>          at
> java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:852)
>          at
> java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1509)
>          at
> java.base/java.net.InetAddress.getAllByName(InetAddress.java:1367)
>          at
> java.base/java.net.InetAddress.getAllByName(InetAddress.java:1301)
>          at java.base/java.net.InetAddress.getByName(InetAddress.java:1251)
>          at
> java.base/java.net.InetSocketAddress.<init>(InetSocketAddress.java:229)
>          at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
>          at
> java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
>          at
> java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
>          at
> java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
>          at
> java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
>          at
> java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:189)
>          at
> java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
>          at
> java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
>          at
> java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:175)
>          at
> java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
>          at
> java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
>          at
> java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
>          at
> java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:308)
>
> If I keep the runtime in $APPDIR\runtime, things don't fail in this way.
>
> Smells like a bug in the app launcher to me.. but maybe it's in the runtime?
>
> Any assistance would be appreciated (including telling me where I should go
> to ask this, if this list isn't appropriate).
>
> Thanks,
>
> Scott



More information about the core-libs-dev mailing list