In the folder you placed the jar file try making a file called "run.bat" and inserting these lines:
@echo off
java -Xms1024M -Xmx1024M -jar server.jar nogui
pause
If this doesn't work you can try some of these fixes (from chatgpt dont know if they work)
1. Make sure you have the latest version of Java installed on your computer. You can download the latest version from the official Java website:
https://www.java.com/en/download/2. Make sure that your system meets the minimum requirements for running the Minecraft server. You can find the system requirements on the official Minecraft website:
https://www.minecraft.net/en-us/download/server3. Try downloading the server.jar file again from the official Minecraft website. Sometimes files can become corrupted during download, and downloading the file again may fix the issue.
If these doesn't work you can just try using a website that hosts the minecrafts servers for you
Some of these websites is: Minehut, Aternos, Server.pro, Freemcserver, etc.