next up previous contents index
Next: 8.6 Useless stuff (Version Up: 8. Appendix Previous: 8.4 Field and Event


8.5 Introduction to JAVA with VRML

Under construction !

Setting up Java and VRML on your machine

Just one word for now. Working with the Java and VRML (both the internal and external) authoring interface can be quite an ugly experience right now. It somewhat contradicts all Java propaganda you may have heard from SUN about portability. Depending on what software roams in the inside of your Win95 it may take several few hours to get you going. For some stuff you'll need days.

If you know some french check out /guides/vrml/java/vrml_top.html produced by Sylvere. It may help you going, e.g. tells you how to deal with autoexec.bat and various incompatible Java/VRML libraries.

Else, please check out the Tutorials Section of our VRML Pointers Index. We do collect pointers to all help we find on the Net.

In any case it is probably best not do deal with locally run Java Applets. Put your stuff on a WWW Server. If you don't want people to look at it, just protect it. On most Unix servers you only need to copy an .htaccess file to your directory, i.e. just grab one from another directory.

Learning Java:

Learning JAVA is a tough thing if you never did any kind of ``real'' programming.

I usually recommend learning Javascript first since it is very handy for VRMLScripting anyhow. See our JavaScript Page for the most important pointers. If you didn't know it before: Javascript and Java are two very different languages. JavaScript an object-based scripting language that is quite easy to learn. Note that there are many variants, e.g. Javascript for Netscape integrates with HTML and the Netscape Browser. VRML plug-in versions of Javascript allow you to script VRML nodes.

Java is an object-oriented programming language that is difficult to learn. To our students (who usually never did any real programming) I recommend to study [Bishop, 1997]. This book also teaches about programming (you need to go through about half of the book before starting to play with VRML classes).

If you know some programming, you can ``learn by example'' (as I am doing it), but you ought to have at least 1-2 Java Tutorial books at hand if you never did any C or C++ programming. I was and am suffering from the following problems:

Java's syntax is awfully ugly (some instructions really look meaningless) compared to other modern well designed languages. Note that ugliness was a design choice in order get this language accepted by C programmers. Once you know that a line like:
     public void init( )
starts defining a method that returns nothing you are catching on :)

Java is very faschist about typing. E.g. a boolean ``VRML'' variable is not the same as the ``ordinary'' boolean. Hmm I was so naive about inheritance. When you work with Java VRML classes you will do a *lot* of translating (casting) back and forth.

Java was hailed as a small and elegant language. Quite true in principle, but useless propaganda again for practical use, because in reality you have to learn a lot of libararies. It will take you weeks to master those. A lot of them are VERY badly documented if you take into account all the enthousiasm about Java).

So: Java is not Java, but a particilar version of Java which may or may run with your browser PLUS zillions of library classes that you will have to master.

You may consult our See our Java Page for some important pointers.

next up previous contents index
Next: 8.6 Useless stuff (Version Up: 8. Appendix Previous: 8.4 Field and Event
D.K.S. - 1998-03-18