The JMS standard is an API standard. Applications written using the standard do not need to reference the classes from any particular JMS implementation. Instead JNDI is used to obtain a connection factory (example). The intention being that the JMS implementation used can be changed though configuration, rather than having to change code.
In regards to the LD_LIBRARY_PATH, EMS uses JNI and the LD_LIBRARY_PATH is needed, so the EMS jar used by your application can find the native library.