I know there are similar questions posted before and I went through those but still its not working for me.
I am creating a sample JMS test class (chat application) and uses javaee.jar and javax.jms.jar. I can test it through Eclipse IDE and it works fine. But I am trying to run through command prompt so I can run multiple windows.I managed to compile the Chat.java file and it created the Chat.class. But when i try to run it, I get could not find or load main class. These are the commands I used:
From the src/domain folder:
javac -classpath javaee.jar;javax.jms.jar Chat.java---- this created Chat.Class inside domain folder where domain is the package name
The I ran the following command from src folder
java -classpath javaee.jar;javax.jms.jar domain.Chat ---- this gives me the could not find or load main class domain.Chat error message
But when I run without the -classpath parameter(java domain.Chat), it reads the main() and gives me different error since it cant find the jms jar files.
E:\eclipse\Spring\JMSChat\src>java domain.Chat
Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/MessageList
ener
So basically it finds the Chat.class file when I don't pass in the classpath parameter and it cannot find the class when I use the classpath to add the jars. I tried running it from within domain folder as well as from src folder, but no luck. Any clue what I am doing wrong?
Thanks in advance.
.to the classpath ie-classpath .;javaee.jar;javax.jms.jar?