Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-23 Thread Andy Herrick
I also had a JDK16 bin dir on my path ... I can get the error you show below (Error occurred during initialization of VM) if I clear my PATH, which is different from the error I get when running without moved runtime, so I can reproduce problem and test the fix. I am using a script like:

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-22 Thread Scott Palmer
> On Sep 22, 2021, at 11:22 AM, Andy Herrick wrote: > > I still don't get the error your report. Is there something else that needs > to be set up for using instrumentation ? Nothing that I’m aware of. Maybe there is something to do with Visual C/C++ runtime libraries that I have

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-22 Thread Andy Herrick
I still don't get the error your report.  Is there something else that needs to be set up for using instrumentation ? I do get a different error when I have both runtime and jre directories after "cp -r jre runtime" (in FetchURL/build/application/FetchURL dir) As built (before copy): $

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-22 Thread Scott Palmer
Sorry That last build with the Oracle OpenJDK needed the build file changed to have vendor = JvmVendorSpec.ORACLE as well as the command line property pointing to the path to the jdk, Scott > On Sep 22, 2021, at 10:24 AM, Scott Palmer wrote: > > I reproduced it with the AZUL's

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-22 Thread Scott Palmer
I reproduced it with the AZUL's distribution of OpenJDK (with JavaFX modules bundled) and I just changed: vendor = JvmVendorSpec.ADOPTOPENJDK And get the same error with that build of OpenJDK as well. “OpenJDK Runtime Environment Temurin-17+35 (build 17+35)” You can try that, as

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-22 Thread Andy Herrick
I can't seem to get your testcase to work with the Oracle JDK configured. I can build, but then when I run $ ./build/application/FetchURL/FetchURL.exe I get: *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message c an't find transform methodID at JPLISAgent.c line:

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-22 Thread Andy Herrick
Thanks Scott This will help a lot because I couldn't reproduce this using just a splash screen as I expected I could. I will look at this example this morning. /Andy On 9/21/21 7:05 PM, Scott Palmer wrote: I’ve uploaded a project that reproduces the problem to JDK-8274087

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-22 Thread Alan Bateman
On 21/09/2021 20:49, Scott Palmer wrote: : The agent is needed in my real app only to get an instance of the Instrumentation interface. As a general point, the Instrumentation object should never be leaked to applications or libraries. I have no idea what the agent does here but you should

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-21 Thread Scott Palmer
I’ve uploaded a project that reproduces the problem to JDK-8274087 Regards, Scott > On Sep 21, 2021, at 3:49 PM, Scott Palmer wrote: > > I have discovered that I have to have my Java Agent configured in the .cfg > file for it to happen: >

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-21 Thread Scott Palmer
I have discovered that I have to have my Java Agent configured in the .cfg file for it to happen: [JavaOptions] java-option=-javaagent:$APPDIR\libs\MyAgent.jar The agent is needed in my real app only to get an instance of the Instrumentation interface. In my test code, where I have

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-21 Thread Andy Herrick
I thought I could create a reproduction scenario by using an app with "-splash:" arg then moving the jre as you did, but I have not yet been able make it fail. /Andy On 9/21/2021 11:43 AM, Scott Palmer wrote: On Sep 21, 2021, at 11:40 AM, Alan Bateman wrote: On 21/09/2021 15:54, Andy

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-21 Thread Scott Palmer
> On Sep 21, 2021, at 11:40 AM, Alan Bateman wrote: > > On 21/09/2021 15:54, Andy Herrick wrote: >> >> I found the problem in >> open/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp >> >> we call SetDllDirectory() with the path to the bin dir in the default >> runtime

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-21 Thread Alan Bateman
On 21/09/2021 15:54, Andy Herrick wrote: I found the problem in open/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp we call SetDllDirectory() with the path to the bin dir in the default runtime directory, not the actual runtime directory. since on Windows we never use other

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-21 Thread Andy Herrick
I filed:     JDK-8274087: Windows DLL path not set correctly. for this, and will work on a fix for JDK18 and backport to JDK17.0.2. /Andy On 9/21/2021 10:54 AM, Andy Herrick wrote: I found the problem in open/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp we call

Re: [External] : Re: What causes java.lang.InternalError: platform encoding not initialized ?

2021-09-21 Thread Andy Herrick
I found the problem in open/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp we call SetDllDirectory() with the path to the bin dir in the default runtime directory, not the actual runtime directory. since on Windows we never use other than the default runtime location - we had