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 post and replies

Return to the JAVA problem some example simulations will work but the EjsConsole.jar fails thread
Login to post to this thread

JAVA problem some example simulations will work but the EjsConsole.jar fails
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
http://physics.bu.edu/~duffy/NS548_simulations/ITOP_EJS.html

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


Replies to JAVA problem some example simulations will work but the EjsConsole.jar fails

Re: JAVA problem some example simulations will work but the EjsConsole.jar fails -
Francisco Esquembre
236 Posts

Hi,

I am almost sure that the problem is that you version of Java is not 1.7 or later. The simulations are typically generated to be 1.6 compliant. But EjsS itself requires Java 1.7 or later.

Update to the latest Java (something around version 1.8) and the problem must be solved.

Best,

Paco



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