aaron-kelley.net

My little corner of the Internet

Posts Tagged ‘Java’

Can’t pin Eclipse to the taskbar in Windows 7

Mildly annoying problem with a simple solution.

If you use the Eclipse IDE on Windows 7, you may notice that it does not behave nicely on the taskbar.  If you pin it to the taskbar, once your workspace is open, Eclipse will add a second icon to the taskbar (and right-clicking it does not yield any option to pin it).  From what I’ve read, you may have to be using the 64-bit version of Eclipse to experience this issue.

To fix it, you need to add the path to your 64-bit JDK’s bin directory to your system PATH variable.  And, it needs to come before C:\Windows\system32 on your PATH.

The reason for this is Eclipse will execute under C:\Windows\system32\javaw.exe if that is the first potential JVM that it finds.  Eclipse only demonstrates this troublesome taskbar behavior when it is running under javaw.exe.  If you add a JDK path to the PATH variable that it will find first, it will use that JDK’s jvm.dll as the JVM and everything will be fine.

If you need help figuring out how to set your system PATH variable or where your JDK is installed, consult Google.  If you’re using Eclipse, then you must be a programmer, so I am assuming that you know about such things.

That’s all!

MySQL, Tomcat 6, and Ubuntu 9.10: Blah

Trying to set up a JSP application on Ubuntu 9.10, using Tomcat 6 and MySQL 5.1 (both from the Ubuntu repositories).  I was getting a curious error when trying to get a connection to the MySQL database from the JDBC DriverManager:

SQLException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
SQLState: 08S01
VendorError: 0

After searching for a while and going through some solutions that didn’t work for me, I found the answer here.  I’m re-posting it because that answer is posted in Spanish.  :-P

All you have to do is open /etc/init.d/tomcat6 in your favorite text editor (as root), find the line that looks like TOMCAT6_SECURITY=yes, and change it to TOMCAT6_SECURITY=no.  Then, restart the Tomcat server (sudo service tomcat6 restart).  Ta da!!  MySQL connections are now working.

Now, there’s probably a better way to do this that doesn’t involve completely turning off “TOMCAT6_SECURITY,” but this seems fine for a small test project which is what I’m working on (it will eventually be deployed on the JBoss server).  I’ll be sure to update this post if I find it… or if you know anything, leave a note in the comments below.

Java icon appears in system tray, even when you told it not to?

Alright, here’s some Sun Java silliness I ran across a while back and just found the fix for.

If you’re running Java applications on Windows, you may have noticed that Sun likes you to see a Java icon in the system notification area when a Java application is running. You can get rid of it by right-clicking on it and selecting “Hide icon,” but it’ll just come back next time. There’s an option in the Java control panel to hide the icon… But sometimes, in Vista, it shows up even though you’ve told it to hide.

(more…)

Getting Started with JNI and C++ under Windows

This is a step-by-step guide to getting started at using JNI with C++ under Windows.

(more…)