I have a jar file which mentions the main class in the manifest. When I try to execute the jar using the following command
java -cp .;./* com.foo.MainClass <
You will need your own classloader to deal with this. -jar only respects the information in the Manifest and wildcards are not allowed there.
-jar
You might find the example of a reloadable class useful: http://www.exampledepot.com/egs/java.lang/ReloadClass.html