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.

Help: "Could not find or load main class org.colos.ejs.osejs.Osejs" post and replies

Return to the Help: "Could not find or load main class org.colos.ejs.osejs.Osejs" thread
Login to post to this thread

Need help troubleshooting
Nic Wong
1 Posts

Hi! I am a new user, trying to install EJSS. I am encountering the same problem with 5.3, 6.0 and 6.01. The first time I open EjsConsole.jar after installing or editing the .EjsConsole.txt settings file, it prompts me to select a workspace directory. Once selected (I use the default /workspace inside EJS's folder), it closes. Subsequently, when opening, it also just automatically closes as well.

The error message is:

Error: Could not find or load main class org.colos.ejs.osejs.Osejs
Caused by: java.lang.ClassNotFoundException: org.colos.ejs.osejs.Osejs
The program selected is NOT running. Error code=1

I cannot find any info on why this problem may be surfacing for EJS. Could I get some assistance with this?

Edit: It seems to work when I open it from Powershell. No idea why - if anyone can help to explain I would really appreciate it!


Replies to Need help troubleshooting

Re: Need help troubleshooting -
Francisco Esquembre
228 Posts

Hello.
What is your operating  system ?

My blind Suggestion is this: make sure you have unzipped the distribution file (not jut run the EjsConsole.jar from within the zip) This can happen in Windows.

Paco



Re: Need help troubleshooting -
mark elvy
1 Posts

While executing, when JVM does not find a .class file with the specified name then a run time error occurs saying “Could not found or load main class”. The reason why this happens is mostly due to:

  • Wrong Class Name
  • Invalid Classpath

Main class could not be found when there is typo or wrong syntax in the fully qualified java class name or it does not exist in the provided classpath. You must ensure that you add the location of your .class file to your classpath. So, if its in the current folder, add . to your classpath. Note that the Windows classpath separator is a semi-colon( ;) . If you want to execute the main() method in MainClass, you must use the full class name, including package name, in the java command.

 



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