In my experience, this problem had nothing to do with Java path. Actually I had installed java for 64 bit machine and had compiled my C# program with 32 bit settings. Calling a 64Bit program was not possible from a 32bit program. So i changed my Target platform to "Any CPU" and it worked fine.