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 some example simulations will work but the EjsConsole.jar fails

Return to the General Comments forum
Login to post to this thread

Java problem with EJS ... what did I update to create it - June 12, 2016 at 12:39
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

JAVA problem some example simulations will work but the EjsConsole.jar fails - July 22, 2015 at 1:20
Gary McRobert
1 Posts

I have instaled jdk1.8.0_51 and EJS_5.1 when I attempt to launch the app via the terminal

java -jar ~/Desktop/EJS_5.1/EjsConsole.jar

I get this error

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/colos/ejs/osejs/EjsConsole : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.colos.ejs.osejs.EjsConsole. Program will exit

IF I luanch one of several examples I downloaded from

for example java -jar ~/Desktop/ejs_ITOP_Star.jar it works very well

Can anyone tell me what to do to fix this I know very little about JAVA

Current Replies - View all
Re: JAVA problem some exa...   (Francisco Esquembre - July 23, 2015 at 2:48)
OSP Projects:
Open Source Physics - EJS Modeling
Physlet Physics
Physlet Quantum Physics
STP Book