NX二次开发自动加载非DLL外挂异常

你好 一个大难题需要帮助
问题遇到的现象和发生背景 java开发的外挂放在startup目录下无法像dll一样自动加载外挂
遇到的现象和发生背景,请写出第一个错误信息
用代码块功能插入代码,请勿粘贴截图。 不用代码块回答率下降 50%
运行结果及详细报错内容
我的解答思路和尝试过的方法,不写自己思路的,回答率下降 60% 尝试过写一个简单的dll外挂打开cmd窗口命令运行java程序, 但是java程序会提示获取不到NX的 UFSession, 运行环境不符合获取session
我想要达到的结果,如果你需要快速回答,请尝试 “付费悬赏” 请问有没有方式 使用NXOpen获取其他函数库写一个简单的dll, dll里面操作NX打开.jar文件(即java的外挂)-即不是命令行窗口执行java外挂, 而是通过二次开发操作NX在NX软件中打开java外挂

在每个NX安装目录下都有案例,对应不同语言的源码,每个具体案例下会有一个说明文件,其中包含怎么运行和一些特殊说明,自己详细去看下。
如下是一个JAVA开发后工具应该放置的路径和设置的环境变量:
Files required
Any part file
ChangeFaceColor.java
ChangeFaceColor.dlx
The dlx file must be placed in one of the following locations:
From where NX session is launched
$UGII_USER_DIR/application
For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly recommended. This variable is set to a full directory path to a file containing a list of root directories for all custom applications. e.g., UGII_CUSTOM_DIRECTORY_FILE=\ugii\menus\custom_dirs.dat

以及如何运行这个工具的步骤:
Unless noted otherwise, the commands in these instructions must be run from an NX command prompt. See the general notes of the examples for instructions on how to start an NX command prompt.
Instructions for Windows: All commands are the same as in Unix except substitute "make" with "nmake -f Makefile_win".
Interactive mode
Compile the example with following command:
make
Start NX.
Open any part file with some faces that you can select to change the face color. You can also create a new part file and create some faces by inserting features that create solid geometry.
In NX, go to File - Execute - NX Open, select ChangeFaceColor.jar, and press Ok. The Change Face Color dialog will be displayed on the screen.
Select one or more faces in the Face Collector block. You can specify face selection intent rules from the Face Rule list on the NX Top Border Bar.
Select the new color for your selected faces using the Object Color Picker block.
Click OK or Apply to set the color of the selected faces to the new color.