Current time: 18:25   
trading-shim Frequently Asked Questions
Certain recurring questions tend to come up in mailing list and support contexts; the links below address or point to further resources about the most common areas of inquiry.
 Show Categories 
Jump Links

Sun's Java

The Sun
java, version 1.4 series Software Development Kit (SDK) was initially used in the development and operation of the IB tws, so near as we can determine. Accordingly our development was started against the j2sdk1.4.2 variants.

As we got familiar with the TWS, it became clear that the JDK ("Java Development Kit ") was more appropriate for our needs, and so we have first moved to the Java 1.5 series (Sun for some (marketing<?>) reason has chosen to drop the leading '1.' and calls that series the '5.0' 'jdk', and installs itself, calling itself: jdk-1.5.0_10-fcs ). So, as of 1 January 2008, we use JDK 1.6 in both our development and production environments; IB recommends 'Java 5.0 or higher' as of 1 April 2008.

Versions actually in daily use by the developers (last updated 080402)
Version
 Centos  Sun jdk or sdk used  Notes 
5 j2sdk-1.4.2_09-fcs   OBSOLETE in 2008 PER IB 
4jdk-1.5.0_10-fcs
5jdk-6u5-linux 32 bit CentOS installation 
5jdk-6u5-linux-x64 64 bit CentOS installation 

Note: As a matter of history, we started development of the trading shim using the IBM Java implementation, but that product yielded us obscure errors in the TWS' operation. We finally traced our errors back to differing behaviors of the TWS under the IBM implementation compared to that of the Sun JDK, and so we abandoned the IBM product.

An archive of older JDK's is maintained by Sun at:
http://java.sun.com/products/archive/index.html
which we point to, as it offers a full collection on one web page, of Sun's offerings over time. We do NOT recommend these in preference, but rather point out an easy to navigate archive.

Additionally the current Sun JDK offerings are here, but as we find the selection mechanism less clear to a person doing their first JDK installation, we list it second:
http://java.sun.com/javase/downloads/index.jsp
Our purpose here is to help a person get a JDK installation set up under Linux, Once it is working, it is then appropriate to cut over to the latest.

We have no objection to using the current Sun releases. Indeed, as security issues appear [see e.g., CVE-2007-3005] from time to time in the JDK's, we recommend using the patched current releases initially. The potential problem is that they may not be the recommended or tested version for the TWS.

We have tested these instructions with these package versions, and verified with various TWS clients, that they are functional:
[herrold@xeon Java]$ ls -1 *bin
j2sdk-1_4_2_09-linux-i586-rpm.bin
j2sdk-1_4_2_14-linux-i586-rpm.bin
jdk-1_5_0_06-linux-i586-rpm.bin
jdk-1_5_0_08-linux-i586-rpm.bin
jdk-1_5_0_10-linux-i586-rpm.bin
jdk-1_5_0_11-linux-i586-rpm.bin
jdk-1_5_0_14-linux-i586.rpm
jdk-6-linux-i586-rpm.bin
jdk-6u1-linux-i586-rpm.bin
jdk-6u2-linux-i586-rpm.bin
jdk-6u3-linux-i586-rpm.bin
jdk-6u4-linux-i586-rpm.bin
jdk-6u5-linux-i586-rpm.bin
jdk-6u5-linux-x64-rpm.bin

How to install the sdk or jdk under Linux for console use

  1. Download the proper package from Sun. The 'package' name will vary over time, of course; Both 'j2sdk', and 'jdk' prefixes refer to the Java SDK. (Note: we have always used 'wget' to retrieve the Java binary from the Sun site, once its URL had been discerned with a graphical browser. We have received reports that using a GUI browser can sometimes 'lock' or leave a failed download in place.)
  2. Use chmod that package to 755 to make it 'executable'
  3. Run the binary: ./binary to extract it into binary RPM form
  4. Install it using the rpm package manager: sudo rpm -Uvh jdk*rpm (sample session)
  5. Fix up the binary search path in /etc/profile (this for a jdk1.6.0_03 package ...)
    JAVA=""
    export JAVA="sun"
    export JPATH="/usr/java/jdk1.6.0_03"
    export JAVA_HOME="$JPATH"
    export CLASSPATH="$JPATH/bin"
    pathmunge $JPATH/bin before
    
    ... perhaps pedantically, this stanza has to be before the 'unset pathmunge' (which removed the function) and also before the 'export PATH' in /etc/profile (which makes the revised PATH available later) as well.
  6. Log out and in again to make the changes in the paths take effect
Note: We are of course aware of ways to do path fix-up other than in /etc/profile, and of 're-sourcing' the file to avoid the log-out and log-in steps. We found going through such details confused our end users, in testing with them. We choose this approach for simplicity of explanation. If you know enough to 'carp', you already understand 'nix PATH variable model more than we choose to document here. But it would be nice for Sun's RPM packager to use: /etc/profile.d/ and remove the need for this discussion. ;)

Over time, as new SDK's are issued, the exact JPATH variable value will change; on another machine, a slightly older version was present. As an example, using the facility of the rpm packaging tool to list all of the files and directories under its management, and looking for a unique program (here, javac), we find:
[herrold@centos-4 ~]$ rpm -ql j2sdk | grep 'javac$' /usr/java/j2sdk1.4.2_09/bin/javac [herrold@centos-4 ~]$
so in our example, we would use the trimmed base directory path: /usr/java/j2sdk1.4.2_09 for that release of the SDK.

Happily, in recent versions of its Java packaging, Sun has added a 'courtesy' path: /usr/java/latest to its RPM packagings, and so one can the simpler:
JAVA=""
export JAVA="sun"
export JPATH="/usr/java/latest"
export JAVA_HOME="$JPATH"
export CLASSPATH="$JPATH/bin"
pathmunge $JPATH/bin before
and thereafter one no longer needs to edit /etc/profile, as new jdk are installed.

This may be confirmed as properly installed by this command:
[herrold@centos-4 ~]$ rpm -V j2sdk
missing     /usr/java/j2sdk1.4.2_09/jre/javaws/javaws.pack
missing     /usr/java/j2sdk1.4.2_09/jre/lib/charsets.pack
missing     /usr/java/j2sdk1.4.2_09/jre/lib/ext/localedata.pack
missing     /usr/java/j2sdk1.4.2_09/jre/lib/jsse.pack
missing     /usr/java/j2sdk1.4.2_09/jre/lib/plugin.pack
missing     /usr/java/j2sdk1.4.2_09/jre/lib/rt.pack
missing     /usr/java/j2sdk1.4.2_09/lib/tools.pack
missing     /usr/java/j2sdk1.4.2_09/lib/unpack
[herrold@centos-4 ~]$
(The 'missing' files are from a haphazard upstream packaging, and are a harmless warning).

Adding Java to the web browsers

Adding links to the plug-in for the Mozilla / Firefox / SeaMonkey [RHEL] browsers is also useful. The links need to end up in the common directory used by these browsers, which is: /usr/lib/mozilla/plugins/ . Determining which particular Java library to link is somewhat dependent on the libraries present; which of the following to use is determined by reference to the upstream documentation. Find the candidates thus:
[herrold@centos-4 ~]$ rpm -ql j2sdk | grep plug | grep so$
/usr/java/j2sdk1.4.2_09/jre/lib/i386/libjavaplugin_jni.so
/usr/java/j2sdk1.4.2_09/jre/plugin/i386/ns4/libjavaplugin.so
/usr/java/j2sdk1.4.2_09/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so
/usr/java/j2sdk1.4.2_09/jre/plugin/i386/ns610/libjavaplugin_oji.so
[herrold@centos-4 ~]$

and then as root, link as appropriate into /usr/lib/mozilla/plugins/

... so ... did I get it installed right?

We can re-source the profile to update the PATH, and then test it this way:
[herrold@centos-5 ~]$ . /etc/profile
[herrold@centos-5 ~]$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)
[herrold@centos-5 ~]$

Other Voices

See Also: the Firefox instructions to similar effect
 and we point here from the CentOS wiki on the topic

Jump Links: [ Text (console) ] | [ Web browsers ]
Last modified: Wed, 08 Oct 2008 17:56:16 -0400

HomeSearchInterior documentationProgram documentationFAQDownloadPDFsScreen shots ]  [ Contact UsSite MapBugzillaMailman |  Mailing List Archives: (MainLicenseAboutPressCopyright ]

Copyright (c) 2006 ... 2009 trading-shim.com, LLC, Columbus, OH