2
如何檢查Java 3D是否在客戶端上安裝?我可以使用它來顯示關於缺少需求的消息。提前致謝!如何檢查Java 3D是否從我的Java應用程序安裝?
如何檢查Java 3D是否在客戶端上安裝?我可以使用它來顯示關於缺少需求的消息。提前致謝!如何檢查Java 3D是否從我的Java應用程序安裝?
我有類似的問題。在我的情況下,J3D jar文件可用,但不是平臺二進制文件。
try
{
GraphicsConfigTemplate3D gconfigTemplate = new GraphicsConfigTemplate3D();
GraphicsConfiguration config = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getBestConfiguration(gconfigTemplate);
}
catch (Error e) // You shouldn't normally catch java.lang.Error... this is an exception
{
System.out.println("Java3D binaries not installed");
}
您可以嘗試從Java 3D API中加載一個類,並將您的邏輯放入catch語句中。即
try {
Class.forName("javax.media.j3d.J3DBuffer")
}
catch(final ClassNotFoundException e) {
//Your logic here
}
我知道,我知道,例外不應該是預期的。
我認爲這比以前更完整。聽起來像罐子是不夠的。 – javydreamercsw 2011-05-11 13:20:14