sun java on Ubuntu with IB TWS

Discussion in 'Trading Software' started by runningdeer, Mar 29, 2011.

  1. Is everybody on Ubuntu 10.10 running tws with the sun jre installed? I can't seem to get tws to load when using sun, only with openjdk. With sun java 1.6.0_24-b07 64bit, after logging in and half my windows coming up, it just stalls. With openjdk, everything opens fine but windows act very strange; charts will redraw themselves incorrectly, windows cannot move past a certain point on the screen, etc.

    I am wondering if I installed the sun java incorrectly. I installed it via the package manger on ubuntu off their repositories and not directly from their website(which was recommended).

    Has anybody gone through something similar and can lend a hand?

    Thanks in advance.
  2. GTG


    Are you sure that installing Sun Java via the packaga manager is the recommended way? I haven't run TWS on Ubuntu, but last year when I needed to install Sun Java On Ubuntu, everything I was reading recommended NOT installing it using the package manager....
  3. Thanks for the response.

    I've read both sides of the story. Today, I will get rid of the package installed sun-java and do a new install from the website download.

    Hopefully this will give me a solution.
  4. I've always installed it "by hand" from the download from Sun and have never had a problem. If you install each new release into a different directory, it makes it very easy to swap between java versions without fiddling around with package management.

    Just put a JAVA_HOME line into your .profile eg

    export JAVA_HOME=/home/myusername/java_version
    and a script something like to run TWS

    cd /home/myusername/IBJts
    $JAVA_HOME/bin/java -cp jts.jar:pluginsupport.jar:riskfeed.jar:hsqldb.jar:jcommon-1.0.12.jar:jfreechart-1.0.9.jar:jhall.jar:other.jar:rss.jar -Xmx256M jclient.LoginFrame .
    If you update the JAVA_HOME line in your profile, you need to do this

    $ . .profile
    for the change to take effect. Alternatively logout and login.
  5. For some reason the 64 bit JVM needs more storage for Java class storage. Try adding -XX:MaxPermSize=200M to your startup script.

    Change this:
    java -cp jts.jar:hsqldb.jar:jcommon-1.0.12.jar:jfreechart-1.0.9.jar:jhall.jar:other.jar:rss.jar -Xmx512M jclient.LoginFrame .
    To this:
    java -cp jts.jar:hsqldb.jar:jcommon-1.0.12.jar:jfreechart-1.0.9.jar:jhall.jar:other.jar:rss.jar -Xmx512M -XX:MaxPermSize=200M jclient.LoginFrame .
    IB should correct this on their web site.

  6. I remember having trouble with the 64bit jre and tws. Try using the 32bit runtime.

    The more curious question is who still uses linux (osx excluded) as their desktop :eek:
  7. As of 2009, NY Times estimated Ubuntu usage alone is at 12 million. Even this number is low because a lot of users dual-boot from a Windows machine and also excludes all the other distributions out there. Choose Linux for your desktop if you are serious about security or don't want buy into the Microsoft or Apple monopoly ecosystem.

    I'm very happy being in the small minority of desktop OS's because we all know which OS has little to no viruses or malware and much better security. I hope Apple grows their desktop base even more frankly because now OSX is getting to be as much of a target for hackers as Windows.
  8. I've always used the 64-bit openjdk package and TWS works just fine. Here's my version info:

    java version "1.6.0_20"
    OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1)
    OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

    Also, here is the command that launches TWS from a shell script:

    java -cp jts.jar:hsqldb.jar:jcommon-1.0.12.jar:jfreechart-1.0.9.jar:jhall.jar:wtf:ther.jar:rss.jar -Xmx512M jclient.LoginFrame .
  9. The OpenJDK in Ubuntu always had the advantage that you would get updates automatically with the Ubuntu's built-in software update system. As of Ubuntu 10.10 Sun Java is available under Applications -> Software Center which sets you up for auto updates from Oracle which occur much more frequently. That's the main reason I prefer Sun Java, but 64 bit JVM users do have to use that parameter I mentioned. Even OpenJDK starts having problems when you start to churn the software, like using charting functions, the scanner, etc. It has to do with running out of storage for Java classes, when too many are loaded then odd things start happen.

    In geek-speak, if you declare a static variable in a Java class you expect it to always hold it's last value as long as the application is launched, but if classes get unloaded and reloaded those static variable are wiped out - this is a new behavior and not taken into account by "old" Java programmers. Giving classes plenty of memory side-steps this issue by never unloading classes.

  10. t482


    I use the 32 bit version with Oracle Java - no problems reported

    I've used both the downloaded java and from the 3rd party repo.

    Actually I think the repo just points to a shell script to download and install....

    Also all the plugins work fine - links to python and R... Cheers

    #10     Apr 4, 2011