简体   繁体   English

如何使用netbeans dist分发Java3d jar文件?

[英]How to distribute Java3d jar files with netbeans dist?

I have a java project on netbeans (Mac OS X) that uses Java3d . 我在使用Java3d netbeans(Mac OS X)上有一个Java项目。 On the mac version of java distribution, java3d is already included. 在Mac版本的Java发行版中,已经包含java3d。 However now I want to distribute my application as jar for other platforms. 但是现在我想将我的应用程序分发为其他平台的jar When I Clean and Build the project in netbeans it generates the dist folder as the follow: 当我在netbeans中Clean and Build项目时,它将生成dist文件夹,如下所示:

.
├── lib
│   ├── AbsoluteLayout.jar
│   ├── jgrapht-jdk1.6.jar
│   └── swing-layout-1.0.4.jar
├── README.TXT
└── MyApp.jar

But as you can see it has not included any jar file related to java3d. 但是正如您所看到的,它没有包含任何与java3d相关的jar文件。 How can I force Netbeans to include necessary jar files to my distribution folder? 如何强制Netbeans将必要的jar文件包含到我的分发文件夹中?

Update: 更新:

On a second try, I downloaded java3d from Oracle website and extracted everything until I found three java3d related jars. 第二次尝试,我从Oracle网站下载了java3d,并提取了所有内容,直到找到三个与java3d相关的jar。 However adding them to the project causes an error in Ubuntu when I try to run java -jar MyApp.jar : 但是,当我尝试运行java -jar MyApp.jar时,将它们添加到项目中会导致Ubuntu错误:

java.lang.UnsatisfiedLinkError: no j3dcore-ogl in java.library.path

This software is targeted for several platforms and I want my users to be able to run it by simply executing the jar file without getting involved in any technical issues. 该软件针对多个平台,我希望我的用户能够通过简单地执行jar文件来运行它,而不会涉及任何技术问题。 How should I do that? 我应该怎么做?

Looks like there are native libraries involved here. 似乎这里涉及本机库。 This won't be easy; 这并不容易。 maybe impossible. 也许不可能。

Netbeans won't help your users. Netbeans不会帮助您的用户。

Perhaps you can script some setup commands to create the appropriate environment variables, then call the executable JAR. 也许您可以编写一些设置命令脚本来创建适当的环境变量,然后调用可执行的JAR。

You'll have to create different versions of the script for *nix and Windows. 您必须为* nix和Windows创建不同版本的脚本。

You'll need to package everything in a ZIP file that arranges the artifacts as needed or write an installer to help. 您需要将所有内容打包到一个ZIP文件中,该文件可以根据需要排列工件,或者编写安装程序来提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM