The exe which is used to start the process needs to export that flag in its module file (PE on Windows or ELF on Linux).
So, when you simply develop locally by using the default java.exe/javaw.exe launcher, then it would be
this exact exe file which needs to have this flag exported. Now, since you cannot simply edit that exe file to make it export that symbol, there are a couple of other options:
- use the
JNI Invocation API to write your own launcher
- configure the java.exe/javaw.exe in the Nvidia Control panel to use the dedicated graphics card
- configure the BIOS to disable Optimus and always use the dedicated card
The Nvidia extension you mentioned merely allows to select the graphics card to use when you have multiple dedicated graphics card, such as via SLI in a desktop computer.