Prospeed orginal
Prospeed orginal

Reputation: 15

How to open and run an exported JAR file

While watching a tutorial on YouTube, the creator exports a Java JAR file and opens it which runs his created app. When I attempt to repeat the process, it just opens the content of the JAR.

my attempt

What the creator did.

Upvotes: 1

Views: 2428

Answers (2)

Abra
Abra

Reputation: 20914

Looks like your computer is configured to open JAR files with WinRAR.

You can change this by going to Control Panel > Default Programs

Set java as the program to open JAR files.

Alternatively you can open a cmd window or PowerShell window and type the command

java -jar <path to your JAR file>

Good Luck!

Upvotes: 3

Ramanlfc
Ramanlfc

Reputation: 8354

This is because your jar file is being opened in winrar by default. right click on your jar and from open with... choose java to run the jar

Upvotes: 1

Related Questions