I am writing a program that uses three classes and an external .jar library. I got the code to work on my windows machine, on IntelliJ, and am trying to get it running on my Raspberry Pi (Raspbian).
The three classes are called "CommHandler", "SocketHandler" and "ReadAndWrite". ReadAndWrite being the main classes that calls to the others.
The three classes and the .jar library are together in the same directory (home/pi/Final1). I have moved to the directory these are all under and used the code below to compile it all, no errors occur from doing this.
javac -cp jSerialCom-2.0.2.jar *.java
The problem occurs when it comes to running the file, I have been using this to try and run it
java -cp jSerialCom-2.0.2.jar ReadAndWrite
This returns the error message as mentioned in the title
Error: Could not find or load main class ReadAndWrite
I have tried explicitly stating the directory to get to the ReadAndWrite file all resulting in the same error message. (Shown below, tried with both "/" and ".")
java -cp jSerialCom-2.0.2.jar home/pi/Final1/ReadAndWrite
If you have any idea how why this may be happening/how to solve it that would be great.
Thanks
P.S. I have looked at other questions but cant seem to solve my problem from them