Home » x Other Posts » Solved: Cygwin Java path issue on Moshell connection

Solved: Cygwin Java path issue on Moshell connection

After installing Cygwin and Moshell, you may run into this error message while trying to connect Moshell:

Unable to execute /cygdrive/c/Progra~2/Java/j2re1.4.2_19/bin/java.exe :
sh: /cygdrive/c/Progra~2/Java/j2re1.4.2_19/bin/java.exe: No such file or directory

Please correct the java installation or check that the correct java path has been specified in one of the files moshell/moshell or ~/.moshel lrc.
Cannot connect to MO service, exiting…

Resolution

You need to correct Java path as it is stated in error message. Open this file with notepad (I recommend Notepad++ for better view):

C:\cygwin\home\Gede\moshell\moshell

Find this line:

java="/cygdrive/c/Progra~2/Java/j2re1.4.2_19/bin/java.exe"

Change it with the following (It might be different in your computer. Make sure the path by checking Program Files/Java folder):

java="/cygdrive/c/Progra~2/Java/jre7/bin/java.exe"

Ned Sahin

Blogger for 20 years. Former Microsoft Engineer. Author of six books. I love creating helpful content and sharing with the world. Reach me out for any questions or feedback.

1 thought on “Solved: Cygwin Java path issue on Moshell connection”

Leave a Comment