Windows Tutorial
Verify that the latest version of Java is installed
The Minecraft server (also the Windows .exe) requires Java (also called the Java Runtime Environment or JRE). For your security, you should only use the most recent version of Java. To verify that you have the latest version, do one of the following:
Open Windows Control Panel, find Java (it may be inside the Programs category), and click on Update Now.
If Java has been enabled in your browser, you can also visit
http://java.com/en/download/installed.jsp. This will perform an automatic version check.
The following method will only work if the Java folder has been added to the system path. Open a command window. (Whilst holding the Windows key down, press R to open the Run dialog. Type cmd and press enter or click OK.) Once the command prompt has opened, enter the command java -version, followed by the enter key. If a version number is reported, then check the Java website at
http://www.java.com/download/ to see what the most recent version number is.
If you don't have Java, or your version is outdated, then download it at
http://www.java.com/download/. If you also want to be able to use Java in your webbrowser, you will probably have to install the 32-bit version, even if you are running 64-bit Windows, because most webbrowsers are still 32-bit. (Read more about this at
http://java.com/en/download/faq/java_win64bit.xml) If you are using a 64-bit webbrowser, or don't need to use it with your webbrowser, you can install the 64-bit version. It is possible to install both the 32-bit and the 64-bit versions, but then you need to remember to upgrade both versions when they are outdated.
Start the Minecraft server
Before starting the server, make sure you place the downloaded file (.exe or .jar) in a folder of it's own. Don't run the server from your desktop, download folder, or any other common place. The server creates several configuration files in the application folder, and these are easier to find if everything is in a dedicated folder.
Double click the file and the server should start. It will put configuration files in the folder, and quit immediately.
The first, and required, configuration you have to do is accepting the EULA. A text file call eula.txt is created in the application folder. Open this file in a text editor (Notepad, Gedit, TextEdit, etc. Do not use a rich text editor like Wordpad.) and change the line eula=false to eula=true. It signifies that you have read and understood the end user license agreement that you'll follow when using the software. If you don't do this, the server will shut down immediately when you try to start it.
If you get an error such as "Can't save
server.properties" and your screen fills with useless, gibberish text, then run the Minecraft Server as administrator by right-mouse clicking on it and choosing 'Run as administrator'. (You may need the administrator password to do this.)
After the first start, you'll probably want to shut it down and then edit some configuration files, as is explained below.
Starting from the command line
Both the Java and the executable version can be run from the command line with extra parameters to configure for example memory usage.
Running from the command line requires that the Java folder is included in the system path, or that it is specified on the command line. The Java installer does not do this for you (anymore), so you will have to do this yourself. You can either modify the system path permanently, or make a temporary modification every time you start the server.
Either method requires that you know the location of the Java folder. Unless you made changes while installing Java, this folder should be:
if you are using 32-bit Windows: c:\Program Files\Java\jre7\bin\
if you are using 32-bit Java on 64-bit Windows: c:\Program Files (x86)\Java\jre7\bin\
if you are using 64-bit Java on 64-bit Windows: c:\Program Files\Java\jre7\bin\
Permanently modifying the system path
Right click Computer (either on your desktop, in the Start menu, or in the Windows Explorer).
Click properties.
Click "Advanced system settings".
Click "Environment Variables".
Under system variables, find the Path variable.
Click edit, and append to the end of the current value a semicolon ";" and the location of your Java folder, for example c:\Program Files (x86)\Java\jre7\bin\. (See above.)
Close any command windows that are open. (A reboot is not required.)
Now (re)open the command prompt and enter the command java -version. Java should now report the installed version.
Specifying the path on the command line
The system path can also be modified from the command line. This way, the modification is forgotten as soon as you close the command window.
To modify the system path, enter the following command:
set path=%path%;c:\Program Files\Java\jre7\bin\ (if "c:\Program Files\Java\jre7\bin\" is your Java folder, see above).
Instead of modifying the system path, the Java folder can also be entered as part of the Java command:
"c:\Program Files\Java\jre7\bin\java" -version (again, if "c:\Program Files\Java\jre7\bin\" is your Java folder).
Please note: when entering the path together with the Java command you need to enclose the command inside quotes, because of the space character in the path (between Program and Files). When modifying the path, the quotes are not required.
Starting the server
To start the server, change to the Minecraft server folder using the cd command, and enter the following command:
java -jar minecraft_server.jar
(Replace minecraft_server.jar with the .jar file name if it is different, for example minecraft_server.1.7.10.jar. Use minecraft_server.exe if you're using the executable server.)
If you prefer not to use the server's Graphical User Interface (GUI) to enter administration commands, simply add the option nogui to the end of the command, so that it reads: ... minecraft_server.jar nogui
You can also replace the java command with javaw. Javaw.exe is identical to Java.exe but there is no associated console window. This may be preferable when using a .bat file. (See the next section.) Note however that Javaw also doesn't show any error messages in the command window if anything is wrong.
Using the Xms and Xmx parameters, the initial and maximum memory size for Java can be specified. By default, your server runs with about 100 MB of RAM, which is very little. Most people will change their server to run on, for example:
java -Xms512M -Xmx1G ...
java -Xms1024M -Xmx1024M ...
java -Xms1G -Xmx2G ...
Add in -d64 if your server is on a 64-bit computer using 64-bit Java.
Add -o true to tell the server to run in online mode so only authenticated users can join.
Creating a .bat file to store the commands
To start the Minecraft server from the command line, without having to enter all commands every time, you need to create a "batch" (.bat) file.
To do this open a text editor, for example Notepad.
On the very first line add the command
@
EcHo off
so that a command window isn't opened to show the output from our start file.
On the next line, enter the set path command if required. Usually, this is not required and if this is required, it is better off to reinstall Java and the reinstallation process will fix it.
After that you have the command that starts the Minecraft server itself. See the previous paragraphs for the possible commands to do this.
Optionally, on the next line enter the command pause to tell the window to stay open after the /stop command is issued. Useful if you want to read what happened as it shut down.
Save the file, for example as "start-server.bat", in the Minecraft server folder (remember I told you to place the server in it's own folder?). Note: when using Notepad, use quotes around the filename "start-server.bat" when saving, because otherwise Notepad will add a ".txt" extension to the file.
Now the server can be started just by double-clicking the .bat file.
Here is an example of a bat file that starts the Minecraft server on Windows. Put it in the same directory the Minecraft server is.
title run-minecraft
java -Xms1024M -Xmx2048M -jar minecraft_server.jar nogui
pause
Port forwarding so your friends can join using your IP address:
1. Open Command Prompt.
2. Type "ipconfig" without the quotes.
3. If you're not using Wi-Fi, find Ethernet adapter Ethernet. Should look like this:
http://prntscr.com/4ncsr3
4. If you are using Wi-Fi, should look like one of these two:
http://prntscr.com/4nct04
5. Now, under either #3 or #4, you should see "Default Gateway". Copy the IP Address located to the right of it.
6. Now, paste the IP Address into your browser. A login screen should show up. The default in most cases is username: admin , password: admin.
7. Look through your router's page and find Port Forwarding. It can be found in Gaming if you have Linksys or in Advanced if you have an Xfinity router. Here's a screenshot of the Xfinity router:
http://prntscr.com/4nctyf
8. Now, add your local IPv4 address, which can also be found in command prompt, to the IP address text box. For TCP or UDP, choose both. Finally, for the start port and end port, make sure they are both 25565.
9. Go to
ipchicken.com, copy your IP, and send it to your friends to connect.
SOURCE:
http://minecraft.gamepedia.com/Tutor...ng_up_a_server