Please refer to this article to install java
on your computer.
Tutorials/Setting up a server https://minecraft.fandom.com/wiki/Tutorials/Setting_up_a_server#Installing_Java_3
Create a new folder on your desktop or somewhere else.
Download server.jar
from this web page and place it in the folder you just created.
DOWNLOAD THE MINECRAFT: JAVA EDITION SERVER https://www.minecraft.net/en-us/download/server
Verify that OwnServer Client is installed.
Start OwnServer Client, select Minecraft
and click Next.
Click SELECT SERVER.jar and open the server.jar
you just downloaded. In addition, check Accept EULA.
Next, click Start to launch the Minecraft server.
Saved data will be created in the folder containing server.jar
.
Wait a moment, make sure that the status of Start Game Server is Running
and click Next.
Clicking Start will expose the Minecraft server running on your computer to the Internet!
Verify that the status of Start OwnServer is Running and select Next.
You can see the public address of your Minecraft server. Share this with your friends!
Start Minecraft and select Multiplayer -> Add Server.
Paste the server address. Note that the server address changes each time the OwnServer client is started.
NOT OFFICIAL MINECRAFT PRODUCT.NOT APPROVED BY OR ASSOCIATED WITH MOJANG