开发者

Run class file using cmd commands

How can I run a开发者_运维百科 class file using a java program with cmd commands?


From your command prompt, type

java classname

where classname is the name of your compiled class. Note that the class must contain a main method.


Your question is a little vague, are you asking how to run java classes within java? If so, take a look at the Runtime class.

Like so:

Runtime.getRuntime.exec( /*params here*/ );

I would suggest using this version (using a String array), as I've had the best outcomes with it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜