Installation of Java 3D for OOP with Tecla
Tags: tutorial, java, beginners, ipn
Published: 2020-11-27 22:31:22

Now continuing with the series of posts. In this occasion I'll explain the "correct" (that worked for me after many many fails) installation of java 3D, and its configuration of the environmental variables to avoid the use of the local temporary variable CLASSPATH every time you need to compile a new program.

It's important to have only the installation that fits with your OS architecture to avoid compilation errors and exceptions with java 3D. So if you have an old installation of java that usually installs both 32 and 64 bits versions (for windows x64) you must uninstall the 32 bits version.

## Step 1: Download.

As same as the previous post you need to have an Oracle Account to download this product, again you can register [here](https://profile.oracle.com/myprofile/account/create-account.jspx) and download the installer for Java 3D [here](https://www.oracle.com/java/technologies/java-archive-downloads-java-client-downloads.html#java3d-1.5.1-oth-JPR), once you entered the page, select the one that fits with your OS (amd64 for x64 64 bits or i586 for x86 32 bits).
![Java 3D download section](https://dev-to-uploads.s3.amazonaws.com/i/cfmm394beeswp98cm0qw.png)

## Step 2: Installation.

Now that you have the installer in your computer, run it.

**Substep 1:** Accept the licence agreement. 
![Licence agreement](https://dev-to-uploads.s3.amazonaws.com/i/dssnyf68nx9ahby5lzz0.png)

**Substep 2:** The Installer will show you where the new libraries will be stored.
![Directory of installation](https://dev-to-uploads.s3.amazonaws.com/i/q2uy66lmqr2menlistf9.png)

**Substep 3:** Wait till the installer finishes the process and click "Close" to exit.
!["close to finish" window](https://dev-to-uploads.s3.amazonaws.com/i/5bfm863nniceag3ifjpg.png)

##Step 3: Environment variables Configuration. 

Now lets start with the most important part of the installation, the configuration of the environment variables. This will help you to simplify the compilation process of your practices so that way you don't need to write a very long command adding the local temporary CLASSPATH variable.

**Substep 1:** To start press the "Windows" + "Q" keys on your keyboard to open the search bar, type the word "variable" and select the "Environment variable" option to open its configuration.
![Windows search bar](https://dev-to-uploads.s3.amazonaws.com/i/vzmz4m6qjyah64ha9461.png)

**Substep 2:** Once the "System properties" windows appear click the "environmental variables" button.
!["System properties" window](https://dev-to-uploads.s3.amazonaws.com/i/srwhgashjoidvr30ppj6.png)

The variables that we're going to edit this time are the variable "Path" of your user (or the "Path" variable of "system variables" wichever you configured in the last post), and the variable "CLASSPATH" created in te previous post, the values you are going to add are the following.

<center>

| variable       | Value                                       |
|:--------------:|:--------------------------------------------|
| Path           | C:\Program Files\Java\Java3D\1.5.1\bin<br/>C:\Program Files\Java\Java3D\1.5.1\lib\ext                                | 
| CLASSPATH      | C:\Program Files\Java\Java3D\1.5.1\lib\ext\*|

</center>

**Substep 3:** Click twice the variable "Path" that you are going to edit and add the values described in the table, once you are done click the "Ok" button to exit the variabe editor.
!["Environment variables" window](https://dev-to-uploads.s3.amazonaws.com/i/dp9n63lu4jn4fuv75x0f.png)

!["Edit path envoronment variable" window](https://dev-to-uploads.s3.amazonaws.com/i/jexr5cp2pvnwo8nkqs0f.png)

**Substep 4:** To edit the "CLASSPATH" variable, click it twice and at the end of the value of the variable put a semicolon (;) to separate the old values from the new one. Now add the value described in the table. Once finished click "Ok" to exit the editor, then "Ok" again to exit the "Environment variables" window and once again to exit the "System properties" window.
!["Edit CLASSPATH environment variable" window](https://dev-to-uploads.s3.amazonaws.com/i/a5v5cmx32blt6x5uvwa4.png)

And That's all, now you can write and compile java 3D programs try it by copying the code of any example of [this site](http://www.java3d.org/samples.html).