Uploaded in February 2014 to www.rart.com/InternetJavaIntroduction.html
Revised March 2017

Java and Rart, an Introduction

The reason for this introduction is that some persons interested in Rart may not be familiar with the Internet and what it offers by way of Java especially on this website, www.rart.com. In addition, the security related changes made by Oracle (January 2014) makes it desirable that users of these pages should understand more of the relationship between computers and software involved in the Internet relation when a user watches a Rart universe over the Internet. I have also included definitions of some vocabulary which I hope will be helpful.

Client and Server Computers: the Web Browser

You are now surfing the Internet using a laptop or other personal computer ( Pads or smart-phones do not count since they do not (yet) run Java). The terminology used is client for you and your computer. The client is connected over the Internet, to a web page, for example, www.rart.com, The page you are looking at is presented to you by the client computer, but the text of page is located on the server from which it is downloaded to the client under control by the web browser. The server could be anywhere but is in case of Rart located in the Boston, MA area. In general, you or any client do not care where the server s located. What you care about is the Internet address which in this case is www.rart.com. There are different web browsers which have in common that that they run on the client computer and allow the user to connect to various web pages which are presented on some server computer. The browsers all attempt to show the web pages in the form that the author intended. All common web browsers (Internet Explorer from Microsoft, Safari from Apple, Chrome from Google, and others) now use a common technique with regard to Java. (However, as of March 2017 only Internet Explorer displays applets and only after the client has taken certain steps to enable the execution of applets downloaded from a specific web site. See below about Enabling Apple Execution)

Java, a Programming Language. Byte code, Virtual Engine

Java was launched in 1995 as a programming language and a method of use which allowed it to meet one of it's very ambitious goals: Compile once, run everywhere. See for example Wikipedia . A very short explanation is that programs written in the Java programming language in a human readable form are compiled, translated, to a sequence of instructions in a code easily read by a computer. The code is called the Java byte code. On the Rart pages a Rart universe is a sequence of Java byte code referenced from the presented text according to the rules common to all browsers. A piece of software, the Java virtual engine on the client computer, reads the sequence of Java byte code, and does what the code says ie. it executes the byte code. We say that the virtual engine executes the applet. The Java virtual engine exists for most of today's computers and operating systems. One reason for the truth of the claim Compile once, run everywhere is that the virtual engine behaves in the same way, the program does the same thing, regardless of the make of the computer or the operating system. The Java virtual engine and some administrative software is called the Java runtime environment or JRE.

Java on the Internet; Applets; Rart Applets running in Sandbox

When Java was launched, Internet was the coming thing. Java was designed to support programming on the Internet. In particular, Java byte code can be referenced from a web page, and executed in a Java runtime environment provided by the browser. The Java programs supported by the browsers are called applets, the name suggesting small applications. For security reasons, the applets were running in a sandbox environment, which means that they had no access to the resources of the client computer. In particular, applets could not read or write client files or could not access other client computer resources, such as printers.  The Rart software system is based on an early release of Java with the main objective to make Rart universes viewable as applets over the Internet with maximum compatibility also with older browsers and the security from running in a strict sandbox environment. Below you may read in the Appendix how various browsers have provided the support for Java applets.

Enterprise Applications

The sandbox environment was not suitable for large computers or networks of computers. The main development of Java over the years have made it more useful for the programming of enterprise applications supporting networks of computers over the Internet and in other ways. The programs are Applications that do not need a browser but have a Java run time environment with full access to the computer's resources on the computer (client or server or not networked computer). Over time, Java additions have included features that have increased the ability of applets. The term "applet" is hardly in use anymore and the functional difference between applets and applications have diminished. 

Java SE, Standard Edition; Java EE, Enterprise Edition; The Browser Java Plug-in

The development of the Java language and the supporting software early split in two main branches: Java SE, for Java Standard Edition and Java EE,  for Java Enterprise Edition. Java SE is freely available for download from Oracle, but for Java EE, license fees are required from the users, in general large corporations with big IT budgets. For personal computers and Internet, Java SE is used and very popular. Many additions have been made to the language and the JRE has been expanded accordingly. The software supporting Java including the compilers and the runtime environment is combined in a download which is called JDK for the Java Development Kit. For Windows, Rart applets use the Java edition, JDK 1.1.8. This takes, when downloaded, 22.5 MB while for the latest edition of Java SE from Oracle, JDK 7u51, takes 123.6 MB. It should be mentioned that lately the run time environment for browsers is provided by a Java plug-in, a program that provides the run time environment running under the browser. This is provided from Oracle and works identically for all browsers. An important point to realize is that the the browsers are encouraging the users to use the latest plug-in. In fact, I believe is a matter of time when the browsers will insist that you always use the latest version of the plug in. To read more about the plug in, see Java Plug-in Technology from Oracle

Increased Capabilities causing Security Problems

Among the Java modifications both for Java SE and Java EE, some have included abilities to use client resources. The new applications allowed are called Rich Internet Applications, or RIAs. Using client resources increase the ability of applications but have apparently also resulted in massive security problems. See for example an article in eWeek Jan 16, 2014. RIAs have for this reason made necessary new considerations for launching Java programs over the Internet. For Rart, even though we still use sandbox applets and also use the old Java JDK 1.1.8, our website has to be modified. To begin with, since January 2014, no applets may be executed without explicit permission by the client anywhere. In the long run the Java community seems to wish to use encryption combined with the signing of Java code to prevent malicious attacks in distributed Java code.

Present Strategy to see Applets; The Exception Site List

When the browser discovers that the web page includes an applet, the browser now, (as of the Java plug in version 7 update 51 or 7u51  distributed in January 2014)  will put up a warning notice saying "Application blocked by Security Settings". The notice has an OK button, but pressing the button will only allow the client to read the text on the page. Any applets are blocked. In order to allow applets the security restrictions have to be modified. All browsers seem to have a panel, the Java Control Panel which can be used to adapt the security to desired level. The simplest way to do this, in case of Rart, is to modify the Exception Site List that list sites or URLs to applets that are allowed to be executed by the browser. This list, is maintained under the Security tag of the Java Control Panel. The Java Control Panel is located differently in different operating systems and is not always easy to find. On Windows XP it is found under the Java entry of the Control Panel. On other Windows systems it is suggested to start a Search for the "Java Control Panel". Once you have found the Java Control Panel, you will see a panel with a number of tabs. Select the Security tab. On this tab you will see the Exception Site List and instructions about how to add a site. See: http://www.java.com/en/download/faq/exception_sitelist.xml

Add the Rart Site to the Exception Site List

To add an applet to the Exception Site List you simply add the full URL to the page with the applet, for example http://www.rart.com/Gallery/Monds20112go/Monds_Demo2go/DemoStartJAR.html to see the applet with the on line demo of the Monds Universes. The entry will remain and you can see the demo at any time. A simpler way, that lets you see all applets on the Rart pages, including those in the Gallery, would be to add make the whole Rart site an exception by adding the URL www.rart.com to the Exception Site List. If you have added a URL to the list, the browser will show a Notice which will contain the words: "Do you want to run this application?" with two buttons "Yes" and "Cancel". The notice will, in addition to a yellow warning triangle, show the URL to the applet (or the site) and the wording "An unsigned application from the location below is requesting permission to run". If the user hits "Yes", the applet will run, and so will any other applets on pages reached from the main page. If, however, the user hits "Cancel" this and any other applets will be blocked as described above. Are there any risks in allowing the running of unsigned applets as described above? Since all rart applets run in the sandbox and all use the very old Java of JDK 1.1.8, which by now should be thoroughly tested, I do not think so.

The Future of Rart Security

In the future, the Rart pages will probably follow the trend and start using signed applets as suggested by the Java community. .This is extra work for the developer and for the observer of Rart universes. Nevertheless, it is my plan. I will probably start an alternate part of the Rart website which will have the same general layout but with self signed applets. Hopefully this will be enough to keep observers flocking to the pages. An alternative is always to run the universes as applications using the Rart application rartrunner as described in the next paragraph.

Rart as Application; the Rartrunner

From the beginning Rart was developed to allow two types of run time environment. A Rart Universe may be seen executing as an applet on the Rart website. However, the universe byte code can also, without recompilation, be executed as an application, that is in an application run time environment with access to the computers resources including the printer. So while the universe is unchanged, the execution environment is different. Crucial is the program called the rartrunner. The rartrunner comes in three flavors, with RRL being the simplest one, the other two rartrunners, RRlet and RR, have RRL as superclass, RRlet is used to invoke a universe on a web page as an applet and RR is used to run a universe as an application. As an application RR provides the ability to freeze a view of the universe for later printout. In order to get access to the rartrunners A-Square is offering to send interested users a CD, or a download against a nominal sum.

Appendix: History of Java Support of Applets

The Java environment has changed considerably over time. For Rart, the importance has always been consistency. A work of Rart, a Rart Universe should look the same always and for all times. In this matter Java has been very successful. With a few exceptions new versions of runtime systems have always been backwards compatible. Nevertheless, it may be instructive to learn about how the Java support has changed over time. The progress has not been straightforward and sometimes interrupted by legal clashes between the huge corporate players like Microsoft, Apple, and Sun Microsystems. The following is a running commentary that has accumulated over the years.

Originally, in 1999 or there abouts,  your browser may not have been Java capable or Java enabled.. Since it is important that the Rart universes be observable in the most common browsers the universes themselves use Java as defined by JDK 1.1.8. This means that they can be seen in Microsoft Explorer and AOL browsers that support Java as defined in JDK 1.1.4, thereby making the Rart universes viewable by almost anybody. However, if you got here because you did not see the floating logo on the banner, please read on!

In the beginning of Java , through 1999, there was a question if the available Java capable browsers were compatible and/or enabled by default. The situation is now quite changed and all main stream browsers are either built Java capable or offer Java by means of a plug-in from Sun. They are also mostly enabled by default and even without the option to turn Java off. It is particularly gratifying that AOL browsers since AOL 5.0 have been Java enabled, with no turnoff option.

Internet Explorer 4.0 and later is OK. My new Windows XP with IE 6.0 came with Java enabled and a Java environment claimed to be 1.1.4. However, it also offers an option (Tools >Internet Options . . . > Advanced) to turn on a Java plug in from Sun, if you have it (One of the crucial items in the Microsoft antitrust court case, was if MS should be required to distribute the Java plug in from Sun and if they did, should it be enabled by default.) Unfortunately the Sun plug in breaks some older applets including the one I had as a banner on this website for a very long time, but it is OK with the present banner.

Netscape Navigator 4.5 is OK and does not seem to have a turnoff option. While Navigator 6 + was dangerously unstable, Netscape 7.0 seems OK. It offers the option under Edit > Preferences > Advanced to disable/enable Java 2. Enabling the optionally downloaded plug in from Sun, breaks old applets just as for Explorer.

The story is the same for Macintosh, Mac OS 9.0 as well as OS X. All main browsers work and are normally enabled. However, older MacIntosh don't handle XOR painting correctly, which brakes the Eggs universe. The Lines and the Polygons also look funny on my G4 Laptop under OS X 1.2. I was extremely pleased to note, however, that the new browser that comes with OS X 1.4, Tiger, the Safari, has a beautiful and fast Java engine. While it can be disabled (under Preferences), it is normally enabled and, again, really, really nice!

For Linux/Unix, I have also checked Opera, which comes with an optional Java plug in from Sun. My RedHat Linux came with Galeon using a Sun plug in (1.3.1_02) and Netscape 4.78 using Java 1.1.5. which all are good for observing Rart universes.

As of now, 2010, matters seem to have stabilized. Most browsers,  Firefox, Mozilla, Chrome from Google, AOL etc. come with Java enabled and are expected to use a Java plug in from Sun, Sun has recently been taken over by Oracle but Oracle has pledged continued support for Java of which Oracle has been a heavy user anyway. Microsoft is supporting Java in the same way, but is posting two levels of warning messages in Internet Explorer 8.0.

In 2013 a number of security related incidents caused Oracle to introduce security restrictions for Java programmed programs, especially applets. With the release in January 2014 the new restrictions prevented execution also of sandboxed applets, (applets with no access to the resources like files or printers of the client's (your) computer). In the long run the solution should be the introduction of signed encrypted code using security certificates. However, this solution is difficult both for the Java programmer and for the client. In the meantime Oracle proposes a solution where the client allows the execution of applets by entering the address of approved websites in the Java Control Panel. A warning message will still appear but any sandboxed applet should not be risky.

I have always liked and preferred the Mozilla
Firefox browser. Mainly because it has been created as a community effort and for this reason not been encumbered by the suspicions of commercial bias that inevitably is attracted by the browsers from the giants of the IT-world. I am referring to Explorer from Microsoft, Safari from Apple, and  Chrome from Google. I was all the more saddened when, in March 2017, I launched a new automatic update of Firefox (Version No. 52). This stopped, without comment, the execution of  any Rart applets on www.rart.com. Most disappointing to me, as well as presumably to many others, since the original (1995) intent and beauty of Java was the universal ability to execute Java applets over the Internet.

March 2017: This is where we are now.
However, Internet Explorer still supports the execution of the Java applets on the Rart website provided you have followed the steps outlined under Allowing Applet Execution. It is likely, but not yet tested, that the same applies also to the Safari browser from Apple. It is my sincere hope that Mozilla will make it possible to display Java applets with a minimum of difficulties.