Archive for the ‘Linux’ Category

What is JAVA_HOME in Ubuntu?

Tuesday, October 21st, 2008

Some Java programs need the environment variable JAVA_HOME, such as Tomcat. In Windows operating system, JAVA_HOME is the directory that the JDK is located. However, in Ubuntu if you install JDK with “sudo apt-get install sun-java6-jdk”, the JDK’s files are extracted to many directories like /usr/bin, /usr/lib, etc. What is JAVA_HOME?

Some people thought it should be /usr because in Windows the Java compiler “javac” is in JAVA_HOMEbinjavac. So in Linux it should be JAVA_HOMEbinjavac and JAVA_HOME=/usr. I don’t think it is the best sulotion. Because I found /usr/bin/javac is not the real Java compiler, it is just a link. I used “ls -l /usr/bin/javac” to see what it links to:

/usr/bin/javac -> /etc/alternatives/javac

And /etc/alternatives/javac is also a link. It links to /usr/lib/jvm/java-6-sun/bin/javac. This is the real Java compiler. And the path is similar to that in Windows. So I think JAVA_HOME should be /usr/lib/jvm/java-6-sun in Ubuntu Linux.

The Keyboard doesn't Work in Virtualbox on Ubuntu 8.04.1

Sunday, October 19th, 2008

I installed Ubuntu Linux 8.04.1 yesterday and removed Windows. But sometimes I need to use Windows, so I have to install VirtualBox.

I used “sudo apt-get install virtualbox-ose virtualbox-ose-modules-generic” to install VirtualBox. Its version is 1.5.6. However, I found a serious problem. My keyboard doesn’t work in VirtualBox. If a virtual machine is running and I click the window, the mouse is captured by the virtual machine. When I press the right Ctrl key the mouse should be released. However, it doesn’t work. I have to press Ctrl+Alt+Backspace to restart X. Some people said that the problem can be solved by disabling support to complex characters. But I need the multi-language support so that this method is unuseful for me.

Finally I found a good solution. I used “sudo apt-get install scim-bridge-client-qt” to install the scim-bridge-client-qt package and reboot my computer. Then the keyboard can work in VirtualBox. Although the solution is very simple, I don’t know why. It may be a bug in Ubuntu 8.04.1.

A Strange Problem of Ubuntu

Tuesday, September 23rd, 2008

Today I met a very strange problem when I was working in Ubuntu Linux. The screen became black and the keyboard and the mouse didn’t work. So I had to reboot the computer. But it can not. It seemed that the ramdisk couldn’t work. I also tried Ubuntu LiveCD. However, the problem didn’t disappear. It said “… is not an 8139C+ compatible chip. Try the “8139too” driver instead”. I searched the Internet and find a solution. Even though I can’t understand why.

Boot from Ubuntu LiveCD. When a boot menu appears, press ‘F6′ so you can edit the ‘grub’ command line. Add the “irqpoll” options at the end of the line.

In this way the LiveCD run at last. I re-installed the whole operating system. Finally, my Ubuntu works. I feel this problem is very strange. I don’t know why it happened.

If You are a Linux Fan…

Tuesday, September 23rd, 2008

I have been working with Linux for about four months. But for some reasons, I have to go back to Windows. When I saw the interface, I felt a little unaccustomed. (more…)