skip to Main Content

I’m trying to install the .tar.gz package on my new ubuntu machine.
I’m coming from Windows Environment. Usually after the package have been extracted one can easily call "java -version" on the folder where the binaries are located.

However my archive binaries, which I extracted on a custom folder, are not found when typing

These are my environment variables:

franrizz16@sviappmfa01:~/programs/java/jdk1.8.0_202/bin$ echo $JAVA_HOME
/home/franrizz16/programs/java/jdk1.8.0_202
franrizz16@sviappmfa01:~/programs/java/jdk1.8.0_202/bin$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/franrizz16/programs/java/jdk1.8.0_202/bin

when typing "java -version" the output is the following:

-bash: /home/franrizz16/programs/java/jdk1.8.0_202/bin/java: No such file or directory

but the file actually exists in "bin" folder.

I expected that typing "java -version" would output the jdk version.

This is my ls on $JAVA_HOME/bin folder:
enter image description here

What am I missing?

Thanks

2

Answers


  1. you could extract the source to /opt directory.
    e.g.:

    sudo tar -xf /location-to-file/jdk1.8.0_202.tar.gz -C /opt
    echo "JAVA_PATH=/opt/jdk1.8.0_202" >> $HOME/.bashrc
    echo "PATH=$PATH:$JAVA_PATH/bin" >> $HOME/.bashrc
    

    close the terminal and reopen and then try run java -version to make sure it work

    or you could read the easier way here
    https://gist.github.com/filipelenfers/ef3f593deb0751944bb54b744bcac074

    Login or Signup to reply.
  2. Given what you wrote in your comments, you downloaded the 32-bit version of the jdk. You need to download the 64-bit (x86_64) one.

    You mentioned you are accustomed to Windows running both 32-bit and 64-bit programs. While 64-bit versions of Linux can run 32-bit programs just fine, they don’t do it out of the box. You’ll need to install 32-bit library support. See this thread on how to do it.

    But unless you have very specific reasons to run 32-bit software on a 64-bit machine, you’re better off simply installing the correct version.

    (Note, here I’m talking about x86 specifically. I don’t know whether ARM or MIPS behave differently regarding 32- vs 64-bit).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search