Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have followed all the steps described on the Getting Started with DB2 Express v9.7 e-book and installed DB2 Express-C on my Mac. The installation succeeded without a problem.

I did setup OS X according to this blog post: http://programmingzen.com/2009/01/20/installing-db2-on-mac-os-x/

After the installation, I set up the DB2 instance environment as instructed and was able to start DB2 with: $ db2start

But I was unable to run db2fs. It returns the following error message:

$ db2fs
sh: /Users/ivan/sqllib/java/jdk64/jre/bin/java: No such file or directory DB2JAVIT : RC = 127

What else do I have to setup in order to make it work on my system?

share|improve this question
    
I had this same problem. The way I resolved it was to create a symbolic link to OS X's java installation. cd ~/sqllib/java/jdk64; sudo ln -s /Library/Java/Home jre –  user14772 Oct 26 '12 at 1:28
add comment

2 Answers 2

up vote 3 down vote accepted

Sounds like DB2 doesn't know where Java is installed.

See the following three links for related information.

Link One

Link Two

Link Three

I realize these are for Linux and you are on Max OSX, but Mac's OS is a variant of Unix, so the solution should be similar.

share|improve this answer
    
Two of those I had already tried prior to asking here. OS X's Java installation doesn't follow the structure of Linux's. For instance, on my system Java is installed on /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java. It doesn't have a jre/ directory, and if I set db2's JDK_PATH to that, it'll assume there's a jre/ and won't find java. –  ivanmp Mar 29 '12 at 14:01
    
@ivanmp - so where is your JRE installed? –  Chris Aldrich Mar 29 '12 at 14:05
    
On the path I outlined above: /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java. –  ivanmp Mar 29 '12 at 14:24
    
Anyway, I was able to make it work thanks to your answer. I re-read one of the links you gave me which I had already tried and although not exactly what I needed, it made me think of a solution, so I'm marking your answer as correct, ok? Thank you for your help! –  ivanmp Mar 29 '12 at 14:25
    
@ivanmp it would be nice if you'd post your working solution as an answer... –  Marius Butuc Jun 29 '12 at 21:25
add comment

To make it easier for future users to find a working answer:

It appears that one method to fix this problem is to create a symlink from the DB2 location to the Java Home you wish to use. Since I told DB2 to use my user when I installed it (this is for a development copy), the command I used to fix this problem was:

sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home/ ~/sqllib/java/jdk64/jre

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.