成功构建我的应用程序后,启动失败,因为它依赖于位于 META-INF 目录中的配置文件,并且在构建后,该目录被压缩到 jar 文件中,因此无法访问配置文件。手动解压 jar,删除 jar 并用 xxx.jar 重命名目录后,程序运行没有问题。SSO 登录 (Kerberos) 需要配置文件。这是代码:
Bundle bundle = Platform.getBundle(Application.PLUGIN_ID);
String path;
try {
path = new URL(bundle.getLocation().substring(18)).getPath();
} catch (MalformedURLException e1) {
System.out.println(e1);
path="";
}
System.setProperty("java.security.auth.login.config",path+"META-INF/jaas-win.config");
路径变量包含类似“plugin/mydomain.pluginame-xxxx.jar/”的内容,但系统似乎需要解压缩 jar。
那我在构建应用程序时做错了吗?谢谢