Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JNI native launcher issue on Windows 7

Marco MaccaferriJan 23 2025

Hello,

I'm writing a native executable to create a VM with JNI_CreateJavaVM using a private Java runtime (bundled with the application).

The program works well on Windows 11 but I have a weird issue on Windows 7. I know this OS is old/unsupported/etc. but some of my clients are still using it so I need to make it work.

The first issue I have is that, apparently, the jvm.dll can't find its dependencies as it does on Windows 11, it needs the path set to the java runtime bin directory. Fine, if I set the PATH variable manually before launching the program from a command windows, it works well.

The weird issue is that if I set the PATH from within the native executable or use the SetDllDirectory function, then I get an error that it can't find ucrtbase.terminate from api-ms-win-crt-runtime-l1-1-0.dll (the DLL is there as it is part of the JRE).

Has anyone had this kind of problem and solved it ?

I repeat, manually set the PATH before launching the executable works fine, so the loader works, but setting the PATH from within the application doesn't seems to have the same effect. Can't tell the user to set the PATH, this would not be acceptable.

Some additional info, I'm using the JRE 17 64bit (Windows 7 64 bit as well) haven't tried with a more recent JRE. I'm using mingw64 gcc as compiler.

Thanks for any hint on how to solve the problem.

Comments

thatJeffSmith-Oracle Feb 13 2025

Your ENTRA users will get authenticated via JSON Web Tokens, and their Entra roles will determine which ORDS REST APIs they can hit.

When they hit an endpoint, it'll execute code in the database as the database user that owns the schema where the REST API is defined, not as Entra defiend end user. In fact, the Entra users won't have accounts in the database (they could, but wont' need to).

The :current_user field as far as ords is concerned would be the corresponding oauth2 client or JWT issued for the authorizied session.

Your prehook should be able to alter the session to set the context that would put your RLS/VPD security policy in play.

1 - 1

Post Details

Added on Jan 23 2025
0 comments
94 views