Saturday, 6 August 2016

Run jar file in Unix machine

java -classpath "/devuser/test/test/bismaya/TestPOC/poc.jar:/devuser/test/test/bismaya/TestPOC/ojdbc7.jar" com.edu.test.main.Main

While creating the jar make sure you have selected Main as the class containing main method. Add all the jars to classpath by separating :.

Or

java -classpath `pwd` com.edu.test.main.Main.

In this case all the jars should be present in the current dir.

Or

java -jar jarName.jar --> provided there is no dependency jar is required.

Difference between class level and object locking and static object lock

1) Class level locking will lock entire class, so no other thread can access any of other synchronized blocks. 2) Object locking will lo...