Skip to content

Nailgun is a client, protocol, and server for running Java programs from the command line without incurring the JVM startup overhead.

License

Notifications You must be signed in to change notification settings

bryanesquivias/nailgun

 
 

Repository files navigation

nailgun

=======

This repository contains implementations of a nailgun client in Python and in C.

Build status

Table of Contents

What is nailgun?
Benefits of nailgun?
MacOS Build and Installation
Linux Build and Installation
How to run a java program
Other implementations
Legal


What is nailgun?

Nailgun is a client, protocol, and server for running Java programs from the command line without incurring the JVM startup overhead.Programs run in the server (which is implemented in Java), and are triggered by the client (written in C), which handles all I/O.

Note: Nailgun is based on original code developed by Marty Lamb, you can find his original website here. As of October 2017, the repository has been transferred to facebook and is being maintained and used by Buck team. Nailgun will remain available under the Apache license, version 2.0.

Benefits of nailgun?

Elimanate JVM startup time completely and run all of your java apps in the same JVM called the nailgun server which only starts once. This gets rid of the slow startup times of the JVM everytime you want to run a program.


MacOS Build and Installation

To install nailgun on Mac:

brew install nailgun

To start a background server:

$ brew install nailgun
$ java -jar /usr/local/Cellar/nailgun/0.9.1/libexec/nailgun-server-0.9.1.jar 
NGServer 0.9.1 started on all interfaces, port 2113.

Add the required jars

$ ng ng-cp /usr/local/Cellar/scala/2.12.2/libexec/lib/scala-library.jar
$ ng ng-cp s.jar

Linux Build and Installation

To install nailgun on Linux:

sudo apt update
sudo apt install nailgun

Using maven, from the project directory:

mvn clean install

The client is built using make. From the project directory, '

make && sudo make install

To create the windows client you will additionally need to

make ng.exe

How to run a java program

By default Nailgun server runs on port 2113

Assume you have a file HelloWorld.class in

/home/28041/ng-sample/com/testrun/HelloWorld.class

run

ng ng-cp /home/28041/ng-sample
ng com.testrun.HelloWorld

For a more in depth guide go here

Other implementations

  • snailgun, a client implementation written in Scala that compiles to native.
  • railgun, a client implementation written in Ruby.

License

Apache License 2.0

Legal

About

Nailgun is a client, protocol, and server for running Java programs from the command line without incurring the JVM startup overhead.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 71.8%
  • Python 18.4%
  • C 9.3%
  • Makefile 0.5%