APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Java problem with EJS post and replies

Return to the Java problem with EJS thread
Login to post to this thread

Java problem (perhaps) with EJS ... anyone had this "bad class file" error?
Amy Bug
2 Posts

>Hi Folks:
>  We have been using EJS 4.3.X and also 5.0.X for research on active matter.
>
>We are using Macs.  We trying to keep software stable and *not* update Java or OS on machines that run these codes - so we do not lose research progress by having to rewrite  ... even to port them to a later version of EJS.  
>
> One computer (a laptop) abruptly failed to compile our main EJS code. Trying to run with EJSConsole.jar 4.3.7  produces this message:
>
>bad class file: java/util/ArrayList.class (java/util:ArrayList.class)
>class file has wrong version 52.0 should be 50.0
>please remove or make sure it appears in correct subdirectory of the class path.
>import java.util.ArrayList;
>
>  Is there a quick hack to fix this?  I have not updated anything manually ... my Java remains at version  1.6.0_65
>and this version of Java runs the same EJS codes very successfully on three other Macs in my lab.
>
>These are run under EJS 4.3.6 or 4.3.7.   Sometimes EJS 5.0 console runs these codes, but this also is machine dependent.
>
>   Many thanks for your help!
>   Amy Graves
>   Swarthmore College


Replies to Java problem (perhaps) with EJS ... anyone had this "bad class file" error?

Re: Java problem (perhaps) with EJS ... anyone had this "bad class file" error? -
lookang Avatar
lookang
245 Posts

I used to have this same problem before in Windows some time back using ejs 4xxx.

After I upgrade Java to latest, I speculate the issues were resolved.

U may want to test your XML or ejs files on a personal computer with latest Java version before upgrading your Labs mac to be safe.

On a separate matter, you should try the JavaScript favor of ejs modeling tool to modernise your lab simulations to run on Android and iOS too.


OSP@SG blog
OSP@SG Digital Library


OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book