Skip to content
scgray edited this page Nov 7, 2014 · 1 revision

This page covers how to build jsqsh from source. Note that each release comes pre-built for most platforms, you can read more about that here.

Getting the source

This is github. The source is everywhere :) But, you can find pre-packaged files with source code for specific releases here. I'm not going to cover how to work with git to check out jsqsh because that is covered in the github help itself (see the little Help link at the top of the page?)

Building JSqsh

To build jsqsh you need the following:

  • Java JDK 1.6 or later
  • Apache Maven 3.x

Once you have those installed and in your path, you can compile jsqsh with just:

$ mvn clean 
$ mvn package

this will leave behind .tar.gz and .zip files in the target/ directory.

If you want to build a Debian package, just do:

$ mvn -Pdeb clean package

or for an RPM package do:

$ mvn -Prpm clean package

Compiling the JNI Interface

JSqsh has shared libraries pre-compiled in the source tree that support its ability to do piping of output to other programs and to determine the screen width (the command line editing is built into the jline2 library, so it isn't part of jsqsh). To compile this code, do:

$ cd src/main/jni
$ ./configure
$ make

This should leave behind shared libraries in src/main/jni/.libs (the name of these libraries depends on the platform you are using).

The shared libraries produced above are placed into:

src/main/resources/org/sqsh/jni/<platform>-<arch>/

where <platform> is the operating system that the shared library will work on as reported by java (you can find this out via the "os.name" system property. The <arch> is the architecture of the platform as reported by the "os.arch" system property in java.

JSqsh will automatically look for:

src/main/resources/org/sqsh/jni/<platform>-<arch>/libjsqsh.so

however if you need the shared library called something different or located differently for a given platform, you will need to change the code in the class ShellManager.java.

Clone this wiki locally