The JMM is described in section 17.4 of the Java Language Specification (JLS). This is quite a formal part of the spec, and it describes the JMM in terms of synchronization actions and the mathematical construct known as a partial order. This is great from the point of view of language theorists and implementers of the Java spec (compiler and VM makers), but it’s worse for application developers who need to understand the details of how their multithreaded code will execute.
Rather than repeat the formal details, we’ll list the most important rules here in terms of a couple of basic concepts: the Synchronizes-With and Happens-Before relationships between blocks of code.
. . .
For run main class from jar with dependencies:
java -cp example.jar:lib/*:. mypackage.MyClass - UNIX java -cp example.jar;lib/*;. mypackage.MyClass - Windows
java -cp HelloWorld.jar:Dependency1.jar:Dependency2.jar net.kozinaki.common.HelloWorld