java: command not found in cygwin bash

0

I'm trying to run a series of programs in Cygwin.

My current dilemma is running a java file. My input and the error is below.

Gaius@Ellislab2015 ~/muTect-1.1.4-bin
$ java -jar muTect-1.1.4.jar
-bash: java: command not found

How can I fix this?

Gaius Augustus

Posted 2015-05-22T22:24:54.007

Reputation: 175

Answers

1

-bash: java: command not found

You need to add Java to your bash PATH variable.

This is normally done by editing the appropriate lines in ~/.bash_profile.

# User dependent .bash_profile file

...

# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
#   PATH="${HOME}/bin:${PATH}"
# fi

Further reading

DavidPostill

Posted 2015-05-22T22:24:54.007

Reputation: 118 938

0

I added the following to my file in home/.bash_profile (~/.bash_profile), as suggested by DavidPostill, and after looking at documents he referenced:

Before:

# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
#   PATH="${HOME}/bin:${PATH}"
# fi

After:

# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
# PATH=/cygdrive/c/Program\ Files\ (x86)/Java/jre1.8.0_45/bin/:${PATH}
# fi

Gaius Augustus

Posted 2015-05-22T22:24:54.007

Reputation: 175