0

I have recently attempted to install java on ubuntu server 12.04 LTS.

I wgetted the tar.gz file and extracted it to /opt/java and then added /opt/java/bin to the path variable. This all works correctly when typing "java" into the command line, however in scripts it acts as if the command does not exist. Thank you in advance for any answers :)

1
  • I think, you failed to make the script executable. Mar 30, 2014 at 11:35

1 Answer 1

1

did you try putting the whole bin path into the sh file?

/path/to/my/bin blablablajavathigny

if it stil dont work, have you chmodded it? like chmod +x file.sh

4
  • It is already 'chmod +x'ed. Also, is 'path/to/my/bin' supposed to mean '/opt/java/bin' (already done) or '/opt/java/bin/java'.
    – john01dav
    Mar 30, 2014 at 12:00
  • /opt/java7/bin/java is the correct one, good luck
    – nwgat
    Mar 30, 2014 at 12:31
  • @jhon01dav From the terminal, what is the output of whereis java? Mar 30, 2014 at 14:41
  • "java: /usr/share/java /opt/java/bin/java"
    – john01dav
    Mar 30, 2014 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .