java -jar / i want to run NOT the Main class

hi al,

this looks like a little challenge for me now..

I have a jar , namedxxx.jar which contains my Main class, let's say Foo.class.

So, as of now, if i run java -jar xxx.jar it will obviously run Foo.class as 'entry point'

But, without changing the current packaging/manifest, i have to be able to call class Bar.class which is part of the same jar..

So, the ultimate challenge is to be able to run a class with java -jar which is not the Main class specified in the manifest

i was guessing what are my options....

thanx and regards

marco

[600 byte] By [king_of_nya] at [2007-11-27 2:19:09]
# 1
One thing you can do is write a seperate main class outside of your JAR file that imports the Bar class and calls members of Bar in its Main class.Nothing fancy, just a simple main class that wraps Bar.
maple_shafta at 2007-7-12 2:19:09 > top of Java-index,Desktop,Deploying...
# 2
Instead of using -jar, use -cp.For example:java -cp xxx.jar Bar
RichFearna at 2007-7-12 2:19:09 > top of Java-index,Desktop,Deploying...