Running JAR file on Windows

前端 未结 25 2590
故里飘歌
故里飘歌 2020-11-22 01:57

I have a JAR file named helloworld.jar. In order to run it, I\'m executing the following command in a command-line window:



        
25条回答
  •  Happy的楠姐
    2020-11-22 02:45

    In Windows XP * you need just 2 shell commands:

       C:\>ftype myjarfile="C:\JRE1.6\bin\javaw.exe" -jar "%1" %* 
       C:\>assoc .jar=myjarfile  
    

    obviously using the correct path for the JRE and any name you want instead of myjarfile.

    To just check the current settings:

       C:\>assoc .jar  
       C:\>ftype jarfile  
    

    this time using the value returned by the first command, if any, instead of jarfile.

    * not tested with Windows 7

提交回复
热议问题