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.

EJS won't compile any simulation post and replies

Return to the EJS won't compile any simulation thread
Login to post to this thread

EJS won't compile any simulation
Juan M. Aguirregabiria
12 Posts

In my new computer (Windows 7, 64-bit) I have been unable to compile any of my old and new simulations, even after installing the last (non-beta) version and updating my Java RTL. Even for the most simple simulation I get the following error:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.colos.ejs.osejs.Generate.generateModel(Unknown Source)
at org.colos.ejs.osejs.Generate.generate(Unknown Source)
at org.colos.ejs.osejs.Osejs.firstCompile(Unknown Source)
at org.colos.ejs.osejs.Osejs.runSimulation(Unknown Source)
at org.colos.ejs.osejs.Osejs.access$26(Unknown Source)
at org.colos.ejs.osejs.Osejs$12$6.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Any idea?
Thanks


Replies to EJS won't compile any simulation

Re: EJS won't compile any simulation -
Francisco Esquembre
237 Posts

Hi Juan MarĂ­a,

Can you please attach one of the examples that don't compile?

I want to try the very same example.

Paco



Re: Re: EJS won't compile any simulation -
Juan M. Aguirregabiria
12 Posts

Paco:
You can try any of my old simulations in OSP (or the EJS distribution): I am including the first one. No old or new simulation compile, although they compile and run without problems in my other systems (Windows 7 32-bit and Windows 8.1 64-bit): it is probably something related to (my) Windows 7 64-bit and/or the recent versions of Java.
Regards

Attached File: action.zip



Re: Re: Re: EJS won't compile any simulation -
Francisco Esquembre
237 Posts

Juan Maria,

Try the new EjsS 5.0 beta. You will most likely get the same error, but since this release has debugging turned on, we can see where in the code we get this error.

(I tried compiling the action.xml example and it run Ok, as you suspected. I also thing there is something strange with your Java+OS. I think we have seen this problem before...)

Paco



Re: Re: Re: Re: EJS won't compile any simulation -
Juan M. Aguirregabiria
12 Posts

Amazing, 5.0 beta works fine!

It issues some description related messages, which seem harmless:

Add description page error : Couldn't find description file: Introduction
Link = ./accelerated_Intro_1.html
Add description page error : Couldn't find description file: Activities
Link = ./accelerated_Intro_2.html
Add description page error : Couldn't find description file: Author
Link = ./accelerated_Intro_3.html

Thanks a lot Paco
Juan Mari



Re: Re: Re: Re: Re: EJS won't compile any simulation -
Juan M. Aguirregabiria
12 Posts

Now 4.3.7 also works fine!
I had tried installing the last EJS 4.3.7, the last Java jre, the last Java jdk, ... nothing worked. But after installing EJS 5.0 beta and compiling a simulation, 4.3.7 also works fine, after ignoring the warning about the file having been created by a later EJS version.
Version 4.3.7 doesn't issues the warning about description files.
I thought maybe 5.0 beta had changed something in the .ejs file, but 4.3.7 reads it without further warnings and the file it saves only differs in blanks from the file I saved yesterday to another disk.
Thanks again



Re: Re: Re: Re: Re: EJS won't compile any simulation -
Francisco Esquembre
237 Posts

Well, sometimes magic appears and fixes some bugs!

The description related error messages are not harmless. The description pages may not appear when you distribute the JAR file. Please, test.

This should not occur. If still there, let me know and I'll have a second look.

Paco



Re: Re: Re: Re: Re: Re: EJS won't compile any simulation -
Juan M. Aguirregabiria
12 Posts

Paco:

These are the results of my tests

==========================================
With version 4.3.7
==========================================

The description is displayed when the package is run.

-----------------------------
No error in the console

-----------------------------
Compile time warnings:

-----------------------------
Target: Java 1.5
warning: [options] bootstrap class path not set in conjunction with -source 1.5
warning: [options] source value 1.5 is obsolete and will be removed in a future release
warning: [options] target value 1.5 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.

-----------------------------
Target: Java 1.6
warning: [options] bootstrap class path not set in conjunction with -source 1.6

-----------------------------
I don't get the options Java 1.7 and 1.8 (which appear in version 5.0 beta).

-----------------------------
In the Windows 7, 32-bit system I don't get any of the above warnings and I also have the option of Java 1.7 (probably I don't have  there Java 1.8, which, I think, was installed in the 64-bit system only when I tried the last Java SDK).

==========================================
With version 5.0 beta
==========================================

The description is *not* displayed when the package is run.

-----------------------------
The console messages are the same with targets Java 1.5, 1.6, 1.7 and 1.8:

Add description page error : Couldn't find description file: Introduction Link = ./accelerated_Intro_1.html
Add description page error : Couldn't find description file: Activities Link = ./accelerated_Intro_2.html
Add description page error : Couldn't find description file: Author Link = ./accelerated_Intro_3.html

However the files are there. For instance:
"C:\prog\EJS_4.3.4\workspace\output\accelerated\accelerated_Intro 1.html"
(I'm using an old workspace)

-----------------------------
Compile time warnings:
-----------------------------
Target: Java 1.5
warning: [options] source value 1.5 is obsolete and will be removed in a future release
warning: [options] target value 1.5 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.

-----------------------------
Targets: Java 1.6, 1.7 and 1.8
No compile time warning

====================================
With versions 3.47 and 5.0 I have also found two other problems that don't happen in the 32-bit system:

If the target is Java 1.6 the simulation doesn't stop when I try to close it. Afterwards it doesn't appear in the console and the "Processes currently running" list. I have to kill it with the Task Manager.

When I try "Remove compiled code", I get "Couldn't remove compiled code". The code is not removed and if I try again "Remove compiled code", I get "There are no files to process", although the files are still there.
====================================



Re: Re: Re: Re: Re: Re: Re: EJS won't compile any simulation -
Wolfgang
192 Posts

Dear Juan--

Although EJS 4.3.7 and older versions of Java are still available on the Internet, I hope you and other EJS users will migrate to the EJS 5 and Java 8. (We are now calling it EjsS 5 because this version supports both Java and JavaScript.)  Apple has stopped development of the Mac Java VM and Apple now recommends that users obtain Java from Oracle so Mac users will have 64 bit Java 1.7 or 1.8 from Oracle if they are running a recent version of OS X.  We also need these new versions of Java to provide support for JavaScript and new technologies such as WebGL 3D drawing.

EjsS Version 5 has many excellent new features, such as JavaScript and ePub support, but there are some small API changes that you may need to pay attention too.  For example, we have dropped the initial value property in the Inspector for input Elements.  We had far too many programs where a user would set the initial value of a variable using BOTH the Var Table and the Initial Value field in the Inspector.  These two values were often not the same and this conflict sometimes caused a crash.  Good programming practice requires that global variables be defined, initialized, and documented in the Var Table so we dropped this Initial Field in the Inspector panel.  You will get a warning message if EjsS 5 detects the use of the the Initial value field.  The Initial Value is then removed from the Inspector and you must define that initial value in the Var Table.

I hope you will be able to update your old models so that we can get the updated source code into ComPADRE.  The old jar files will still run but users may have difficulty compiling the source code.

Wolfgang



Re: Re: Re: Re: Re: Re: Re: Re: EJS won't compile any simulation -
Juan M. Aguirregabiria
12 Posts

Dear Wolfgang,
I see your point but I also have some concerns. I have found in my own department that many people have old Java jres and will discard any simulation that doesn't run out-of-the box. In fact I had the same problem, years ago, when I submitted to the EPAPS library the EJS simulation for a paper in the AJP: they weren't able to run it because of an old jre...
Anyway, I will try to find time to update my simulations.
Best regards



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