PikaTimer / pikatimer

PikaTimer: An OpenSource race timing application
GNU General Public License v3.0
37 stars 16 forks source link

Could not find or load main class com.pikatimer.Pikatimer #18

Closed MistaWizard closed 6 years ago

MistaWizard commented 6 years ago

Attempting to run the .jar release on both Ubuntu 17.10 (amd64) and Raspberry Pi Stretch and both return Error:Could not find or load main class com.pikatimer.Pikatimer.

segfaultcoredump commented 6 years ago

Which version of java do you have installed?

The app was compiled against JDK/JRE 1.8.0_171

After downloading and extracting the zip file, I can run it from the command line without an error.

C:\Users\john\Desktop\PikaTimer-1.5.jar>java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

C:\Users\john\Desktop\PikaTimer-1.5.jar>java -jar Pikatimer.jar
Exiting Pikatimer.start()
C:\Users\john\Desktop\PikaTimer-1.5.jar>

I do not have an Ubuntu box to test against at this time. All of the linux systems I have are headless.

--john

MistaWizard commented 6 years ago

1.8.0_65 on Raspbian.

segfaultcoredump commented 6 years ago

Can you verify that you are running the following on the command line:

java -jar Pikatimer.jar

Leaving out the -jar flag will result in a could not load main class error.

That said, I'd strongly recommend upgrading to the latest JRE, there were a number of JavaFX bugs fixed between 1.8.0_65 and 1.8.0_171

MistaWizard commented 6 years ago

That is how I'm running them. I was able to get it running on Ubuntu by following this tutorial to install Java via a ppa. Neither installs of openjdk-8 or openjdk-9 worked. I'm going to check it on Raspberry Pi now and see if that fixes the issue there as well. Thank you.

MistaWizard commented 6 years ago

Unrelated to this issue and because I'm seeming to not see any way to contact you outside of here, would you be able to provide a sample RFIDServer or Outreach text file? I currently own an Alien RFID reader (ALR-9800) that I'm going to attempt to use with PikaTimer by either modifying Runway or writing my own middle man application to take tag reads from the Alien reader and parsing them into a compatible file. Thank you again.

segfaultcoredump commented 6 years ago

Thanks for the update. I made a note in the notes for the release to make sure that the JavaFX packages are installed if you are going the JAR route. I did a bit of googling and stumbled upon a Stackoverflow question that seems to indicate that the JavaFX libraries are not included by default with the Ubuntu OpendJDK packages: https://stackoverflow.com/questions/34243982/why-is-javafx-is-not-included-in-openjdk-8-on-ubuntu-wily-15-10

To your side note question, for integrating with the ALR-9800, you have two options: 1) Write out a file in the RFIDServer / Outreach format that the "RFID Ultra / Outreach" file reader can parse. There are really two different formats that the system will parse, the comma delimited format used by RFIDServer / Outreach or the easier tab delimited one used by the Joey app. PikaTimer will figure out the file format by the presence of commas or tabs and react accordingly. The Joey app puts out the following: Chip, Date/Time, Reader #, Antenna # Put in a "1" for the Reader and Antenna. If you swap the commas for tabs in the line below, it should read in chip 12345 at 01:23:45.987 12345,01:23:45.987,1,1 See https://github.com/PikaTimer/pikatimer/blob/master/src/com/pikatimer/timing/reader/PikaRFIDFileReader.java for the gory details of how the data is parsed and which fields PikaTimer just ignores.

2) Option #2 is the more difficult one but makes it easier to use once you are done. Grab the Java SDK for the ALR-9800 from the vendor's website and then take a look at the implementation of the RFIDDirect reader located at https://github.com/PikaTimer/pikatimer/blob/master/src/com/pikatimer/timing/reader/PikaRFIDDirectReader.java Since the RFIDReader does not have a Java SDK, I had to use lower level tcp sockets, so most of the code can be ripped out and replaced by calls to and from the ALR's SDK for reading and making changes. Note that the PikaRFIDDirectReader also includes the JavaFX ui to control the remote unit. A bit of a no-no in terms of the separation of UI and function, but I was never one for following strict code patterns unless somebody was paying me for my time. :-)

--john

MistaWizard commented 6 years ago

I plan on option one for now. Runway does basically the same thing but into Runscore. It gets the data from the reader via telnet. Still working on figuring out how they get the data once connected. Secondly I’m working on a python script, that I may eventually break out into a GUI, that will allow remote manual bib entry in the same format that the Race Timer app uses for export. It opens and closes the file upon each line insertion so Pikatimer will be able to automatically import the new data. Thank you for making Pikatimer. I’ve been looking for something this robust for a long time and am very excited to get going with it.

segfaultcoredump commented 6 years ago

If Runway pulls the data from the reader via telnet, then it may not take too much work with a packet sniffer to figure out the command/response sequence. The RFID Ultra / Joey direct interface also uses a telnet session to the box (but that vendor had the commands documented in the user manual). I don't have one of the readers to test with, but additional contributions for direct reader interfaces would be welcome.

I'm going to close this case since the original issue of the JavaFX on Ubuntu is closed. If you run into any other issues, let me know and open another case. Since you are running from the command line, you will get to see some of the debug output that may help figure out what is going on.