How to install Java 3D on Mac

2019-08-08 09:11发布

I am taking a computer graphics course at my university. I am unable to create 3D graphics using Java since I do not have it properly installed. I downloaded the Java 3D API from Oracle. There is no installer included. Just the raw files j3dcore.jar, j3dutils.jar, and vecmath.jar as well as a few read me files. One of the read me files does contain a link that has instructions for the install. It says I must "Unzip Java 3D 1.5.1 into the "jre" directory of your JDK." Where is my JDK? I found my Java folder System > Library> Java > Extension and moved the files there because I read some other things online. I still get this error message in Eclipse when coding: "Access restriction: the method [whatever] from the type [whatever] is not accessible due to restriction on required library /System/Library/Java/Extensions/j3dutils.jar." But I have this file exactly where it says it should be.

4条回答
一纸荒年 Trace。
2楼-- · 2019-08-08 09:15

If you are using eclipse then you can just download the 3d zip file. Move the jars into your project and right click on them. Select add build path. There should be 3 new jars in the referenced libraries.

查看更多
等我变得足够好
3楼-- · 2019-08-08 09:19

Java 3d version 1.3 is pre-installed in Mac OS X. You shouldn't need to install anything. Perhaps try put things back the way they were?

If you want to upgrade to version Java 3D 1.5, you can download this installer: http://create.ife.no/vr/tools/j3d/java3d_1_5_2-macosx.pkg.zip

查看更多
Root(大扎)
4楼-- · 2019-08-08 09:21

Firstly i would make sure that all those files have the correct permissions on them... based on the "Access restriction" error, it seems like the problem might have to do with that. From the looks of it, you have them installed in the right place (thats where mine is installed anyway)

this is what mine looks like: enter image description here

查看更多
Evening l夕情丶
5楼-- · 2019-08-08 09:32

Open a terminal, navigate to the directory you moved the jars to, and use the command:

chmod +x *.jar

+x is a file permission that allows execution of files as programs; files without this permission set will throw errors if you attempt to execute them. Java is technically a bytecode interpreter and jar files are interpreted rather than run, but it's possible that java checks the file permissions manually before loading classes from jars, in which case it would logically fail with an error similar to that which you're reporting.

查看更多
登录 后发表回答