问题
Context:
- MS Windows 8,
- jre7 preinstalled by MS Windows setup,
- MS Windows PATH environment variable has set to JRE7 bin folder - C:\Program Files (x86)\Java\jre7\bin,
- simbad-1.4.jar is downloaded into a local folder.
Use cases:
simbad-1.4.jar is run by command line
java -jar simbad-1.4.jar
or by just double-clicking on simbad-1.4.jar
In both cases
Simbad requires Java 3D
error message box appears.
Yes, I know, setting-up Java 3D should probably fix the issue but I'd like to just deliver/setup Java 3D together with/in a subfolder to simbad-1.4.jar IOW to not install Java 3D into a standard C:\Program Files (x86)\Java\Java3D location.
Please advise how can I setup Java 3D packaged together with simbad-1.4.jar, or answer a more general question:
- How to deploy a Java client application, which uses Java 3D, packaged together with Java 3D library?
P.S. I know about and I have used -classpath option to successfully run other sample java client apps' .jar(s) I have made exported by using Eclipse but they haven't used nor Java 3D nor simbad-1.4.
回答1:
I'm using a slightly different environment (Win7-64bit, JDK 1.7), but this should work for your environment also.
- download java3d .zip package from https://java3d.java.net/binary-builds.html
- unzip the downloaded file, and there's is another zip file named "j3d-jre.zip"
- unzip 'j3d-jre.zip' in a directory you want to package together.
- place simbad jar file in that directory.
- create a DOS batch file with these lines in it:
@echo off set CLASSPATH=.;.\lib\ext\j3dcore.jar;.\lib\ext\j3dutils.jar;.\lib\ext\vecmath.jar;.\simbad-1.4.jar set PATH=%PATH%;.\bin java -classpath %CLASSPATH% simbad.gui.Simbad
Hope this helps.
来源:https://stackoverflow.com/questions/15848736/simbad-requires-java-3d