I am trying to run a class I made however I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/Destination
I don't understand why it's not working even when I include the necessary jars in the classpath:
java consumer1 -cp activemq-all-5.3.2.jar
-cp option of java command should be placed before the class name:
java -cp .;activemq-all-5.3.2.jar consumer1
Otherwise it's treated as an argument of your main method, not as java's argument. Also note that if you specify classpath with -cp option, you need to include the current directory in order to run .class files from it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With