Double Clicking JAR file does not open Command Prompt

前端 未结 3 1534
礼貌的吻别
礼貌的吻别 2020-11-30 12:02

I want to run a Jar file by double clicking it.

Following is the only Java class file present in it.

import java.io.BufferedReader;
import java.io.In         


        
3条回答
  •  孤街浪徒
    2020-11-30 12:42

    I am using the JDK to open the jar file in Windows 10.

    1. Open regedit → HKEY_CLASSES_ROOT\jarfile\shell\open\command
    2. Change the default from javaw to java

    For example, mine is "C:\Program Files\Java\jdk-14.0.1\bin\java.exe" "-jar" "%1"

提交回复
热议问题