Java配合NX二次开发——搭建环境
Java配合NX二次开发——搭建环境
1.NX配置java的环境变量
UGII_JAVA_HOME
C:\Users\Administrator\.jdks\jdk1.8.0_45
UGII_JVM_LIBRARY_DIR
C:\Users\Administrator\.jdks\jre1.8.0_45\bin\server
//2.Java配置系统的环境变量(个人觉得用绝对路径比较靠谱)
//CLASSPATH
//.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
//JAVA_HOME
//C:\Program Files\Java\jdk1.8.0_45
//Path
//%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
3.idea配置运行库包
<img src="https://www.ugsnx.com/forum.php?mod=image&aid=378781&size=300x300&key=9848084b0fe54e49&nocache=yes&type=fixnone" border="0" aid="attachimg_378781" alt=""><img src="https://www.ugsnx.com/forum.php?mod=image&aid=378782&size=300x300&key=e178fa02bdc4a2ff&nocache=yes&type=fixnone" border="0" aid="attachimg_378782" alt=""><img src="https://www.ugsnx.com/forum.php?mod=image&aid=378783&size=300x300&key=b493e940b5e51a1a&nocache=yes&type=fixnone" border="0" aid="attachimg_378783" alt="">
徐华进 2022/12/19
好的分享值得拥有 谢谢楼主分享 感谢分享 就运行这一句代码 : Session theSession = (Session) SessionFactory.get("Session");
就出现报错
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at nxopen.SessionFactory.get(Unknown Source)
at nxopen.SessionFactory.get(Unknown Source)
at demo.main(demo.java:9)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
... 3 more
Caused by: java.lang.UnsatisfiedLinkError: no libnxopenjavacoreutils in java.library.path:
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2660)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:827)
at java.base/java.lang.System.loadLibrary(System.java:1871)
at nxopen.SignJarCore.loadLibraryCore(Unknown Source)
at nxopen.BaseSession_impl.initialize(Unknown Source)
at nxopen.BaseSession_impl.<init>(Unknown Source)
at nxopen.Session_impl.<init>(Unknown Source)
at nxopen.Session_impl.GetSession(Unknown Source)
... 7 more
页:
[1]