When I run my publisher project in eclipse I have specified path variable as path -> C:\Program Files\rti_connext_dds-5.2.3\lib\x64Win64VS2015 in the run configurations and it runs fine.
However when I export it as jar and run through java -jar publisher.jar I get error "Exception in thread "main" java.lang.NoClassDefFoundError: com/rti/dds/infrastructure/GlobalLock"
I have set the path in the command prompt -> set path=%path%;C:\Program Files\rti_connext_dds-5.2.3\lib\x64Win64VS2015 in the run configurations
You need to set the java classpath (java -classpath "..." -jar publisher.jar). For the '...' replace that with the path to the .jar files that contain all the DDS runtime. See here.