How to make my Java code playable by other people?

Please understand that i'm completely new to coding and i'm trying to learn as much as possible.

I've made a small text adventure game in Java. I wish for other people to see and play it for themselves. How would I go about doing this? I know there's such a thing as a.jar file. A game like minecraft is able to played much like a.exe how can I do the same with my program?

Right now I code in the eclipse IDE

Dunno if this helps.

http://see.stanford.edu/materials/icspmcs106a/44-packaging-jar-files.pdf

When you execute any JAR (Java ARchive), you're starting it in the Java virtual machine. This is why you write
$ java -jar whatever-jar, to start your program.

You need to create a manifest file which describes which class contains the main method.

A basic example might be a one-line file named MANIFEST.txt with the contents
Main-Class: MyClass. You can then make your program using the program 'jar', which is similar in operation to the classic UNIX 'tar'.

For example:
$ jar cfm my-jarfile.jar MANIFEST.txt *.class./*.class
Will create a executable jar named 'my-jarfile.jar' using MANIFEST as it's manifest file using all the class files in the current and parent directory.

https://docs.oracle.com/...index.html