> Why I can type "app.jar" in Windows command line but i cant put
> "Runtime.getRuntime().exec("app.jar");"
>
> in my java code?
Why did you repeat your question?
"app.jar" is not a command; that's why you couldn't execute it. When you
think you execute it from the command line, the command processor is actually
invoking the OS's "preferred app" association and invoking the "java" command.
Runtime cannot do that because you didn't invoke the command processor with
it, you tried to invoke the JAR. Without the command processor, there's
nothing to invoke the OS's association for you.
> Here is my problem. I can write:
>
[quoted text clipped - 6 lines]
>
> because i don't have JDK
Sure you can.
> I can't type
>
> Runtime.getRuntime().exec("app.jar");
>
> either.
Because app.jar is not an executable.
> But i can run app.jar in command line typing
>
> app.jar
Because the command processor knows how to use the OS's application associations.
> My question is: How to run app.jar from code without using JDK? Can
> Runtime be useful here?
You don't need the JDK to run a JAR, just the JRE.

Signature
Lew
Grzesiek - 13 Aug 2007 12:08 GMT
> > but suppose I have only Java Runtime Enviroment and app.jar. So i
> > can't type
[quoted text clipped - 5 lines]
> Sure you can.
> Lew
Thanx Lew, that solves my problem i think :-)