Installing and running JNEXT

The following instructions describe how to set up and run JNEXT on Windows and on Linux.

The Sample Applications

The Linux and Windows setups contain the same sample applications. Currently three sample applications are packaged with JNEXT as described below:

  • JS-SQLite3.html - open this in your browser to use SQLite from JavaScript. This sample demonstrates how to open and read the the tables and contents of any SQLite3 database file on your disk. The JNEXT installation includes a database file named world.db3 which you can test the example with.

  • JS-FileReader.html - open this in your browser to see how files on yout filesystem are read from JavaScript using JNEXT. Clicking the 'Read File' button will display the contexts of your win.ini file in the browser window.

  • POP3Client.html - open this file in your browser to read the subjects of POP3 messages in your server's inbox. Just enter the server and account information and click the 'Connect' button.

  • JS-Sockets.html - This is a generic demonstration of the AsyncLineSocket extension used in the above POP3 client demonstration

Windows

For Windows, just download and install the setup. The setup installs JNEXT so that it works with IE, Firefox, Safari, NN9 and Opera (whichever happens to be installed on your system). after completing the setup, the JNEXT icon () will appear on your desktop

Double clicking the JNEXT icon will open a window with the three sample applications described above.

In order to try out the last example (JS-sockets.html) you should first have either a Perl or a Python interpreter installed on your system since they are used to simulate a server that the JNEXT sample communicates with. You can download and install Python from here and Perl from here.

Once you have Perl or Python installed, start either server.pl or server.py to run the test server on your system and next open the JS-sockets.html in your browser. Click the 'Connect' and you should start seeing messages received from the Perl or Python server.

Site authorization

The set of URLs that are authorized to access JNEXT libraries for a specific browser is defined in a file named auth.txt. The structure of auth.txt is as follows:

url1lib1[,lib2,...,libn]
url2lib1[,lib2,...,libn]
.
.
.
urlnlib1[,lib2,...,libn]

where url1,url2 etc. are a list of urls that are authorized to access JNEXT libraries on the browser and lib1, lib2 ... are the specific JNEXT libraries that each specific url is allowed access to. Specifying '*' for a library enables that url to access all available JNEXT libraries that are installed on the system.

Note that the installed auth.txt file enables any local file full access to JNEXT since the assumption is that you trust the HTML files on your system. Change the settings in auth.txt if you wish to further limit access to JNEXT from your Web browser

Also note that a different copy of auth.txt is used for each browser type. This policy might be changed in the future so that only one file will determine authorizations for all browser types. Below is a table that shows the location of the auth.txt file for various browser types on Windows (location may vary if browser was installed in a location other than the defualt):

Browser typeLocation of auth.txt
MSIEc:\Program Files\Optimistec\JNEXT\auth.txt
Firefoxc:\Program Files\Mozilla Firefox\plugins\jnext\auth.txt
Safaric:\Program Files\Safari\Plugins\jnext\auth.txt
NN9c:\Program Files\Netscape\Navigator 9\plugins\jnext\auth.txt
Operac:\Program Files\Opera\programs\plugins\jnext\auth.txt


Linux

JNEXT 1.0.5 has been sucessfully tested on Linux with Firefox 2 and Netscape 9 browsers. You can download the binaries from here. There are still some issues with Konqueror which are being investigated. It only partially works with Opera which is being looked into as well. Please report any additional successes or failures.

Installing JNEXT 1.0.5 on Linux (i386)

  • Close any existing browser Windows

  • Copy the file jnext.so and the directory jnext to the plugins folder of the browser you use. If you don't have root access this will usually be in ~/.mozilla/plugins

  • If you have root access you can copy the files to the relevant plugins directory. For Firefox this will usually be /usr/lib/firefox/plugins and for Netscape it will be at navigator/plugins

  • Check that your browser recognizes the JNEXT plugin. You can do this in most browsers by (such as Firefox, Netscape, Konqueror and Opera) by typing in the URL field about:plugins. If you do not see JNEXT plugin among the loaded plugins, you'll need to recheck that it has been copied to the correct directory

  • If you wish to test the third (JS-Sockets.html) sample, do the following:

    • Open a terminal window and cd to the sample directory

    • Type python server.py or if you prefer perl perl server.pl

    • In the same directory you'll find a file named JS-sockets.html. Open it with your Web browser.

    • Click the SendCmd() button. This will start sending messages on a TCP socket connection back and forth between the JavaScript code in the browser and the server you previously started.

  • You can edit the auth.txt file by adding or removing URLs and libraries in it. Only pages from URLs whose prefix exists in the auth.txt files are allowed to make use of JNEXT. The auth.txt file is located in the JNEXT directory under the plugins directory of the browser you want to use.

  • Assuming you have Perl or Python installed, open a terminal window and type $perl server.pl or $python server.py to run the test server on your system. Next open the JS-sockets.html in your browser. Click the 'Connect' and you should start seeing messages received from the Perl or Python server.

Site authorization

The set of URLs that are authorized to access JNEXT libraries for a specific browser is defined in a file named auth.txt. The structure of auth.txt is as follows:

url1lib1[,lib2,...,libn]
url2lib1[,lib2,...,libn]
.
.
.
urlnlib1[,lib2,...,libn]

where url1,url2 etc. are a list of urls that are authorized to access JNEXT libraries on the browser and lib1, lib2 ... are the specific JNEXT libraries that each specific url is allowed access to. Specifying '*' for a library enables that url to access all available JNEXT libraries that are installed on the system.

Note that the installed auth.txt file enables any local file full access to JNEXT since the assumption is that you trust the HTML files on your system. Change the settings in auth.txt if you wish to further limit access to JNEXT from your Web browser

Dependencies

The following are the dependencies of the two shared libraries in the current JNEXT installation. If you don't have these libraries installed you should either update your libraries or compile JNEXT from the sources.

ldd jnext.so  (JNEXT framework)

    linux-gate.so.1
    librt.so.1 => /lib/tls/i686/cmov/librt.so.1
    libstdc++.so.6 => /usr/lib/libstdc++.so.6
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6
    libgcc_s.so.1 => /lib/libgcc_s.so.1
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6
    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0
    /lib/ld-linux.so.2

ldd jnext/Sockets.so  (JNEXT Socket extension - soon to be enhanced with additional objects)

    linux-gate.so.1
    librt.so.1 => /lib/tls/i686/cmov/librt.so.1
    libstdc++.so.6 => /usr/lib/libstdc++.so.6
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6
    libgcc_s.so.1 => /lib/libgcc_s.so.1
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6
    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0
    /lib/ld-linux.so.2