InterMapper – Part II

Earlier this month I was migrating Intermapper to Linux when I ran into a problem. The good folk from have got back to me with the following; is a shell script that first tries the following:

1. Look for “java” in the PATH if INTERMAPPER_JAVA is not set, otherwise use INTERMAPPER_JAVA as the path.
2. Try paths: /usr/local/bin/java, /usr/bin/java or /usr/java/bin/java
3. Try bin/java in the following directories where the second part is a directory prefix:

jre j2re j2sdk jdk1. SunJava2- linux-sun-jdk
jre j2re j2sdk jdk1. SunJava2- linux-sun-jdk
jre j2re j2sdk jdk1. SunJava2- linux-sun-jdk

That is, we first try /usr/java/jre*/bin/java, /usr/java/j2re*/bin/java, and so on. The jre*, j2re* directories have the version number in the name. We test any located executables and skip them if they are the “gcj” version of java.

In 4.4.2, if you have a file named with the same prefix as the java prefix directory, the script fails to find java. This bug is fixed in 4.4.3b5. This is available for download from:

You set the INTERMAPPER_JAVA environment variable in your shell’s .bash_profile file:

export INTERMAPPER_JAVA=[path goes here]

I hope this helps!

We’ll see how it goes later today 😉
As well as being symlinked at /usr/local/java I’ll also symlink to /usr/local/bin/java

agra:~# ln -s /usr/local/j2re-1_4_2_10-linux-i586/j2re1.4.2_10/ /usr/local/bin/java

Not quite …

agra:/usr/local/bin# intermapper /usr/local/bin/intermapper: line 199: /usr/local/bin/java: is a directory agra:/usr/local/bin#

Let’s try pointing directly to the binary, it is a /bin/ alias afterall …

agra:/usr/local/bin# ln -s /usr/local/j2re-1_4_2_10-linux-i586/j2re1.4.2_10/bin/java /usr/local/bin/java

Ok, now we are calling the X11 system so the java side of things must be ok (time to leave the console and visit the machine)
This exception is thrown in Unix environments by the Java AWT toolkit when it can’t make a connection to a X11 server.

agra:/usr/local/bin# intermapper Can’t connect to X11 window server using ‘:0.0’ as the value of the DISPLAY variable.


The quick-and-dirty way to solve the problem is to have an X session open on the server’s console, and to allow access to the X server to any X client running on the server. The “xhost” tool can be used to grant access to a particular machine:

# xhost +localhost

will allow any X client, directly running on the server, to access the X server. Once access to the X server has been granted to Apache Jserv, you will have to restart Apache for the changes to take effect. This command can be used for testing purposes. However, disabling machine-based access control is a security risk, and should be avoided in deployment environments.

This solution only works if you have a graphical console plugged on your server. If this were not the case, you would have to use an X server running on a remote machine (and change the DISPLAY setting in your … [2]

agra:/usr/local/bin# xhost +localhost
xhost:  unable to open display ""

After a chat with Shaun … and logged in as user account on the console and terminal session.

xhost +localhost
export DISPLAY=:0.0

Now onto sorting out the product registration (Intermapper – Part III)

Something else that is probaly worth some investigation is ‘sux’;

After ploughing through the site/document somebody else linked above, I found a quick fix to the problem I shared with the OP. Debian has a package called “sux”, as far as I know it’s in Stable & Testing (I installed it in Etch). Just install that and from then on type ‘sux’ instead of ‘su’ when you want to… ‘su’!

It places a wrapper of some description around the ‘su’ command to fix the issue. Other than that ‘sux’ will work identically to ‘su’ but without the errors. [3]

[1.] Error “:java.lang.InternalError: Can’t connect to X11 window server using ‘:0.0’ as the value of the DISPLAY variable”:. [MapInfo]
[2.] Using Xvfb with Oracle9iAS [iDevelopment]
[3.] I’m expecting a terribly obvious answer to this.. [LiveJournal]

This entry was posted in geek and tagged . Bookmark the permalink.

1 Response to InterMapper – Part II

  1. Pingback: InterMapper - Part III « Visible Procrastinations

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.