Contact Us
The Terminal Applet Demo

Screen shots (for those who don't want to run the applet)

Runs on Linux. This applet will work when a licensed copy of SerialPort 6.0 (Linux x86) or later is present on the Linux x86 machine running the browser. Configure the Linux x86 computer per the instructions included with the SerialPort package.

Runs on Mac. This applet will work with Safari, Netscape 7, Camino, when a licensed copy of SerialPort 6.2 (OS X PPC) or later is present on the Mac OS X machine running the browser. Configure the Mac computer per the instructions included with the SerialPort package.

The Termlet Demo of the Java SerialPort class provides a very simple terminal Applet that allows you to access the serial ports of your Win32 PC. In order for you to run the demo, you will need a free serial port on your PC. The port could be connected a different serial device like another PC or a free modem (you cannot use the one connecting to the Internet). Remember that if you connect two PCs together you will need a null modem cable between them.

Termlet has the following restrictions:

  • You must have the Java Plug-in 1.3 or later installed.
  • Currently runs on WindowsNT/98/95/2000/XP
  • No flow control
  • The port parameters are fixed to: 9600 bps, No parity, 8 data bits, 1 stop bit.
  • Library does not support access from other than the demo.

These restrictions do not exist in the SerialPort product.


How It Works

Java technology is based on Virtual Machine (VM) technology (or was initially at any rate), therefore any access to hardware must be provided via native methods. Native methods are built into Java implementations to provide access to hardware such as the video memory, the sound card, and the mouse. Java suppliers, do not provide the native methods needed for serial port access.

Termlet uses native methods similar to those in the Java SerialPort package access the serial ports on the browser machine, thus is requires native code in the form of DLL(s).


Before you can run the Termlet demo you need to perform the following:

  • Download jspWinPiDemo.zip
  • Copy the file(s) in this archive to WinNT\System32 if using Windows NT/2000 or Windows\System for Windows 95/98/XP
  • Edit your Plug-in policy file (see below)


Plug-in Policy file

To allow Termlet to load the native code to communicate with the serial port on your local machine, you need to edit the Plug-in policy file. (editing this file should not be required in the future when the Java Plug-in is properly supported by Certification Authorities)

If you installed the Plug-in using JDK 1.3 or JRE 1.3 with the default settings, this file should be:
C:\Program Files\JavaSoft\JRE\1.3\lib\security\java.policy

If you installed the Plug-in using JDK 1.4 or JRE 1.4 with the default settings, this file should be:
C:\Program Files\Java\j2re1.4.0\lib\security\java.policy

Note: If you installed the Plug-in via the JDK, do not confuse this file with the one in the JDK i.e.
C:\jdk1.3\JRE\1.3\lib\security\java.policy

If you also have JDK 1.3 (Java 2) installed on your machine the java.policy file in the JDK folder will have no bearing on the

Note: If you also have JDK 1.3 (Java 2) installed on your machine the java.policy file in the JDK folder will have no bearing on the Plug-in security (without modification to the registry). Be certain you modify the java.policy file in the Plug-in folder. (by default in the "Program Files\JavaSoft\JRE\1.3\lib\security\" folder)

This is an ASCII file, so you should be able to edit it with virtually any text editor (e.g. vi or Notepad). Add the following lines to the file (e.g. at the top or bottom of the file) and save the changes. Note: This assumes that if you have a local copy of SerialPort on your machine, the files are stored on the C drive.

grant codeBase "http://serialio.com/-" {
permission java.io.FilePermission "${java.home}/lib/ext/jspWinPiDemo.dll", "read";
permission java.io.FilePermission "${java.home}/lib/ext/x86/jspWinPiDemo.dll", "read";
permission java.lang.RuntimePermission "loadLibrary.jspWinPiDemo";
permission java.util.PropertyPermission "*", "read";
permission java.util.PropertyPermission "*", "write";
permission java.lang.RuntimePermission "modifyThread";
};

//If there is a local copy of SerialPort on the CLASSPATH or in ../ext
//Note: we assume the files are on the C drive, with
//versions of the plug-in previous to version 1.3
//the syntax "file:/-" worked for all drives
//this is no longer works with version 1.3. Use the following
grant codeBase "file:/C:/-" {
permission java.lang.RuntimePermission "loadLibrary.*";
permission java.util.PropertyPermission "*", "read";
permission java.util.PropertyPermission "*", "write";
permission java.lang.RuntimePermission "modifyThread";
};

If you have not made previous changes to your Java plug-in policy file you can download the default policy file with the above change added.

Windows Right-click the "java.policy" link below and select "Save Link As" or "Save Target As" then select the directory where your Java Plug-in policy file is installed. (the default is C:\Program Files\JavaSoft\JRE\1.3\lib\security). If your using JDK 1.4 or later, the JRE location changed slightly. e.g. using JDK 1.4.1_01 this will be C:\Program Files\Java\j2re1.4.1_01\lib\security.

OS X. Ctrl-click the "java.policy" link below and select "Download Link to Disk". This will download the java.policy file to the desktop. Due to the security features of OS X, extra steps must be taken to enable java.policy file changes. Details on java.policy changes with OS X.

Download java.policy file to enable Termlet to connect to local serial ports.

This will authorize only applet(s) located in http://serialio.com to load native code.

Note: The browser must be completely restarted before changes to the java.policy file will take affect.


SerialPort Developer Note

If you have purchased and installed the SerialPort product, you may get this message when you try to run the demo.

java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.jspWin)

This is due to the JVM finding the real SerialPort package before it finds the demo. To avoid this error, remove Serialio.jar from the JRE EXT folder, or add permissions to access the jspWin.DLL file. This can be done by duplicating the the lines above for jspWinPiDemo and changing the name to jspWin.


The Run Termlet link is designed for the browers with properly integrated Java.
F
or IE use the Run Termlet - Java Plug-In link

Example of browsers with properly integrated Java.

  • OS X 10.2.6 Safari
  • Linux Netscape 7
  • Windows Opera 7.11+

Run Termlet


Use the Plug-In version with IE, Opera 6, Netscape Communicator 4.5. Using the latest browsers with the above link is recommended. For running on Opera 6, check the Opera notes.

IE 6 on Windows XP does not currently appear to work with JRE 1.4.0, try using JRE 1.3.

Plug-in upgrade notes. If you have installed Plug-in 1.3, and then on the same machine installed Plug-in 1.4 the above link should work. If you have installed only Plug-in 1.4 on your machine, then use the link below, as the above link is likely to request you download Plug-in 1.3.

Run Termlet - Java Plug-In