carlosCharz / fcmxmppserverv2

XMPP Connection Server for FCM using the latest version of the Smack library (4.3.4) + Connection Draining Implementation
47 stars 33 forks source link

[Question] Compiling on Ubuntu Terminal getting this error: “classpath error: ” Works on macOS but not on Ubuntu #28

Closed EvMail closed 4 years ago

EvMail commented 4 years ago

I am a iOS developer but have to work on XMPP server. I use your Java library. Thank you for providing the library. As there is Smack etc I compile a .jar with this command:

mvn clean compile assembly:single

After getting the xmpp-server-jar-with-dependencies.jar I move the .jar file to "~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/" folder. I start to compile the project like this:

java -cp xmpp-server-jar-with-dependencies.jar EntryPoint.java [ARGUMENTS]

In macOS it works. But in Ubuntu it does not work. In ubuntu I use these commands:

javac -cp ~/fcmxmppserverv2-master-2/src/main/java/com/wedevol/xmpp/xmpp-server-jar-with-dependencies.jar ~/fcmxmppserverv2-master-2/src/main/java/com/wedevol/xmpp/EntryPoint.java

java -cp ~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/xmpp-server-jar-with-dependencies.jar ~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/EntryPoint.java [ARGUMENTS]

Returns this error: "error: class found on application class path: com.wedevol.xmpp.EntryPoint"

If I compile without .java extension (command below), it returns this error:

Error: Could not find or load main class .root.fcmxmppserverv2-master.src.main.java.com.wedevol.xmpp.EntryPoint Caused by: java.lang.ClassNotFoundException: /root/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/EntryPoint

java ~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/xmpp-server-jar-with-dependencies.jar ~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/EntryPoint

I searched the web about this but could not solve it. It has been days since I am stucked on this problem. Maybe the solution is very simple but I was not able to detect the problem. Please could you address the problem?

Thank you.

carlosCharz commented 4 years ago

hi @EvMail did you manage to solve it? I am sorry. I just got your message. I think the problem is related with the way you compile and run the jar file?