mjbWorld - Why this is an application

This program is an application (as opposed to an applet). This means that to run it you have to, copy the files to your local computer. Also load a Java Virtual Machine. Then run the program on your local computer.

It would be easier to for the casual user if it could be run from the web. Hovever I havn't taken this appoach for the following reasons:

load the program

how to run

If you want to create an applet the following might work but I have not tried it.

  1. Download and install JRE1.2. If you have installed JDK1.2, it gives you an option of installing the JRE also.
  2. Download and install Java Plug-in. Download and install Java Plugin html converter.
  3. Point Java Plugin to use the JRE1.2. (invoked through StartMenu->Programs->JavaPlug-inControlPanel under advanced tab)
  4. Install Java3D beta1.
  5. Modify your Path and Classpath environment to include Java3D dll's and Java3D jar's respectively (On NT through MyComputer->right click->properties->Environment Tab
  6. Run "keytool -genkey" command to generate your keys. The password you enter here will be needed when signing the jar file.
  7. Pack all your class files into a jar file.
  8. Sign the jar file. using something like "jarsigner MyJar.jar MyKey"
  9. Html file to be changed to pick the class from the class file.
  10. Convert Html file using the HTML converter.
  11. Open the HTML file in your browser.

alternative instructions from Mathias Nousch


1) Download the following software:

a) Java 3D 1.1 Beta 1 API

b) Java Plug-in 1.1.1

c) Java Plug-in HTML Converter

d) JDK 1.2 Beta 4

f) JRE 1.2 Beta 4

2) Install JDK 1.2 Beta 4.

3) Install JRE 1.2 Beta 4 into JDK's JRE Directory.

4) Install Java 3D 1.1 Beta 1 API into the JRE Directory.

5) Install Java Plug-in 1.1.1 into the Plug-in directory of your browser. Enter the Advanced Settings and use your JRE 1.2 (\jdk\jre).

6) Install Java Plug-in HTML Converter. Choose the "specific" option when asked.

7) Edit your environment variables to point to the 3D-classes and 3D-dll's,

e.g.: CLASSPATH c:\jdk\jre\lib\ext\j3dutils.jar;c:\jdk\jre\lib\ext\j3dcore.jar;c:\jdk\jre\lib\ext\vecmath.jar;e:\jdk\jre\lib\ext\j3daudio.jar;e:\jdk\jre\lib\ext\iiimp.jar;.; PATH c:\jdk\jre\bin;c:\jdk\bin;

8) Reboot.

9) Go ahead and compile HelloUniverse.java.

10) Use the HTML-Converter on that directory.

11) Open the HelloUniverse.html inside your browser.

There it is! -- Mathias Nousch

from Rajesh posted to Sun Java3d list

Running java3D inside a browser

Running Java3D inside a browser needs a specific procedure to be followed
because it needs JDK1.2 to run. No browser is JDK1.2 compliant yet and
therefore you have to use the Java Plugin to direct the browser to use the
JDK1.2. We should see JDK1.2 support in web browsers after the JDK1.2 is
publicly released.
In addition the class files for the applet have to be packaged into a jar
file and signed because the class files call native methods from the Java3D
dll. Signing the jar file assures the JDK that it is a trusted applet and
should be allowed to call native methods.

Following are the steps needed to run Java3D programs inside a web browser.

You will need to download the following tools:
a. Either JDK1.2beta4 or JRE1.2beta4 available from
b. Java3D API available from http://java.sun.com/jdc/earlyAccess/java3D/
c. Java Plugin available from
d. Java Plug-in HTML Converter from

Note: For downloading JDK1.2 or Java3D you will need to login into the Java
Developer connection (Registration is free if you are not a member yet).
Warning: If you have applied the Netscape JDK1.2 patch the plugin might not
work correctly. Please take a look at
http://java.sun.com/products/plugin/netscape.patch.html for more

1. Install JRE1.2 or JDK1.2. If you are installing JDK1.2, it asks you if
you want to install the JRE, select yes.
2. Install Java Plug-in.
3. Configure the Java Plugin as follows:
a. Open the Java Plugin control panel. In windows 95/98/NT available
under Start Menu -> Programs -> Java Plugin Control Panel.
b. Select "Enable Java Plugin" and "Show Java console" checkboxes under
the Basic tab. The Java console will help you in identifying any problems
you might face while running the plugin.
c. Select JRE1.2 for the Java Runtime Environment under the Advanced
tab. Do not select JRE1.1 or JDK1.2.
4. Install JavaPlug-in HTML converter.
5. Install Java3D beta1.
6. Modify your path as: PATH=%PATH%;J3D_INSTALL_DIR\bin
7. Modify your classpath as:

Note: For modifying path and classpath:
On Windows NT done through MyComputer->right click->properties->Environment
On Windows95/98 by modifying your Autoexec.bat file.
On Unix by modifying your shell resource file (.SHELLNAMErc). Please note
that on unix the syntax of the command might vary with the shell.

8. Run "keytool -genkey" command to generate your keys. The password you
enter here will be needed when signing the jar file.
This command creates a default key called mykey in the keystore. For
convenience keep the key and the keystore passwords the same.
This command is highly configurable and you might want to explore those
possibilities later.
9. Compile your java3d project java files.
10. Pack all your class files into a jar file using the jar tool. The
command is "jar cvf JarFileName.jar *.class". In case the class files are in
seperate packages you will have to include those directories on the command
line as well.
11. Sign the jar file using something like "jarsigner JarFileName.jar
MyKey". You will be asked for a password. Supply the same password that you
gave while creating the key file.
12. Html file has to be changed to pick the class from the jar file.
You will have to insert the following tag inside the applet tag. <PARAM NAME
= archive VALUE =JarFileName.jar>
13. Convert the Html file using the HTML converter. On Windows 95/98/NT the
HTML Converter is available from Start Menu -> Programs -> Java(TM) Plug-in
HTML Converter -> HTMLConverter.
14. Open the HTML file in your browser.

Note: The tools jar, keytool and jarsigner are distributed with JDK/JRE1.2
and are available under the JDK_INSTALL_DIR\bin.

Replace JDK_INSTALL_DIR with the directory in which you installed JDK1.2,
e.g., "C:\JDK1.2beta4".
Replace J3D_INSTALL_DIR with the directory in which you installed Java3D,
e.g., "C:\JDK1.2beta4\jre".
Replace JarFileName with the name that you want to give to your jar file.

If you do not want to play with the jar and key tools and want to give the
idea a quick try, for reference I am providing some premade Java3D files.
The files provided are HelloUniverse.jar, HelloUniverse.html and .keystore.
To test using these files:
1. Follow steps 1 to 7 from above.
2. Copy the .keystore file to your home directory.
On WindowsNT in C:\WinNT\Profiles\YourLoginName.
On Windows95/98 in C:\Windows.
On Unix in your home directory.
3. Save HelloUniverse.jar and HelloUniverse.html in some temporary
4. Open HelloUniverse.html in your web browser.
This simpler procedure can also be followed if you have already created the
required files (YourJar.jar, YourHTML.html and .keystore) and want to setup
another PC for running Java3D applets.
Note: This HelloUniverse example is inspired by the HelloUniverse example
distributed with Java3D and shows a multicolored rotating cube.

Some points to be noted:
1. If running Java3D in a browser is your purpose, do not waste time using
the JRE1.1.6 or JDK1.2 from the Java Plugin. Use only the JRE1.2 option.
2. Though appletviewer.exe and java.exe do not need the path and the
classpath to be set in the environment to include the Java3D dll and jar's.
If you are using it from the plugin, you will have to set them.
3. Using "signed" jar files is necessary for running Java3D applets in
browsers, though they are not needed for running other JDK1.2 or swing
applications. Signed jar files are also not needed if loading the Java3D
applet from the local disk.
4. Try running some simple small non-Java3D program with JDK1.2 plugin. You
can pick up the applets from the demos directory under JDK1.2 installation.
Please note that before running these applets you will need to convert their
HTML files using the HTML converter. If even those applets fail to run, then
the problem is with the plugin installation.


Attachment Converted: "c:\program files\eudora\attach\HelloUniverse (1).htm"

Attachment Converted: "c:\program files\eudora\attach\HelloUniverse.jar"

Attachment Converted: "c:\program files\eudora\attach\.keystore"



metadata block
see also:


Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.


Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.


This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2018 Martin John Baker - All rights reserved - privacy policy.