- JDK 8
- Maven 3.3 or above
mvn clean package
The jar file produced after building, is an executable one and can be simply run on the command line by java -jar {{path_to_jar}}
.
The server provides the following options:
- Port
-p
: An appropriate port number to listen to incoming connections. - Local Bind Address
-b
: A local address to bind to. - Root Directory
-r
: The root of the directory to serve. (Note:~/
does not work) - Thread Count
-t
: The number of threads to use to handle concurrent requests.
cd {{project_root}}
java -jar target\httpserver-1.0-jar-with-dependencies.jar -t 4 -p 7999 -b localhost -r C:/Users/themanikjindal/Desktop/