Thursday, January 22, 2015

Java applets for physics - a great resource being strangled by security?

As many of my readers know, starting in the late '90s, many clever, creative people around the world wrote cute (and sometimes very sophisticated) Java applets to demonstrate certain physics and engineering concepts.  Examples include this great site by the University of Buffalo, a virtual lab by the University of Oregon, this resource by UCLA, this outstanding site from the University of Barcelona, etc.  Many of us owe a real debt of gratitude for these resources, as they have been great educational tools. 

A problem has arisen, however.  You will notice that none of the applets linked above actually run.  Because of security concerns about Java, the latest versions of Java require applets to have been compiled, authenticated, and certified (via electronic security certificates), or the applets simply won't be run by the virtual machine.   For actively maintained sites (such as the excellent "physlet" effort from Davidson), the authors and maintainers have thoughtfully recompiled and updated their code.  Others (the University of Colorado) have rewritten everything (!) in Flash or HTML5.  Unfortunately, these are the exceptions, and many other cool sites are orphaned, with clever code that can't be run.

If anyone knows a work-around (some kind of emulator that would run the code in a walled-off way?), please describe it in the comments.  It would be a real shame if the accumulated excellence of all those older sites was wiped out.  Thanks.


Jacques Distler said...

If you can download the .jar file(s), I don't see why you can't run them locally.

(I had no trouble with the University of Barcelona applets. The Buffalo ones didn't run with my installed version of Java, but I think that's an incompatibility problem rather than a security setting.)

Janne said...

You could try appletviewer:

This is included in the JDK, so you have to download that from the oracle website (not just the JRE).

Janne said...

As for why downloaded jars don't always run directly, the starting mechanism is different. Normal programs need a main() method that is started, where as applets have init() from the Applet class. Maybe some .jars provide both which is why they can be run both ways.

Anonymous said...

Oh man, losing those would be a real bummer. Both the students and I found those really useful when I adjuncted for HCC and a couple of Lone Star campuses.

DiCenzo said...

Just press "load all" on ur browser and click the 'x' when the virus message comes up Geez!

Douglas Natelson said...

Janne, thanks. I'm trying this now and fortunately the author of one of my favorite apps emailed me the source and the jar file (though the source links to libraries that are lost in the mists of time).

Jacques, perhaps I'm just stupid, but it's not obvious to me on these pages how to download and save the .jar files.

DiCenzo, on multiple browsers and multiple platforms, that doesn't seem to be applicable. Clicking to "ignore" the warnings does not, in fact, run the applets.

Douglas Natelson said...

Ok. Appletviewer works, in the sense that I can actually run the applet on my own machine (and thanks to the development kit and sourcecode I can modify it as well).

However, what I'd really like is for my students to be able to run these things on their own, so that they can play with the models. The question is, how to do this, since I can't figure out a way to get "trusted" security certificates without it costing minimally a couple of hundred dollars per year. Any ideas?

Жаслан Дощанов said...

To open the not signed applets you need to:
1. Have the last Java version installed on the machine.
2. Add site to the exceptions site list.
3. Reload applet or browser.

How to add new entry to the exceptions site list? To do this you need to open the Java Control Panel. The simplest way to open it on Windows is searching for Java. Search result "Configure Java" is what we're looking for.
There is a tab "Security" in Java Control Panel which has the site exceptions list at the bottom.
Using this method you can open any applet. For example, an entry in the exceptions list can look like this:

Murali Rajesh said...
This comment has been removed by the author.
Murali Rajesh said...

The best thing about HTML5 is that it allows the developers to embed the video files, audio files, and high quality graphics without any third party applications.
html5 training in chennai | html5 training institutes in chennai | FITA Academy reviews

Raghu Sharma said...

Hi, actually I'am new to angularJs and infact I'am learning angularjs with online training. I'am having doubt, if you could solve the doubt for me that would be very helpful. The doubt is, how can I reset a “$timeout”, and disable a “$watch()”?
angularjs training in Chennai | angularjs training | angularjs training Chennai

Rekha J said...

This is my first visit to your blog, your post made productive reading, thank you. dot net training in chennai

Karthika Shree said...
This comment has been removed by the author.