[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: no JAVA_HOME in the path



On 2022-08-23 9:40 a.m., Roberto C. Sánchez wrote:
On Tue, Aug 23, 2022 at 09:21:38AM -0400, Amn wrote:
    When I type echo $JAVA_HOME, Debian 11's Konsole displays ... nothing,
    'echo $PATH' reports -
/usr/local/[1]bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:libtool:
    /usr/bin/libtool /usr/share/libtool /usr/share/man/man1/libtool.1.gz -
    However if I type, 'java --version' I get -
/usr/local/[2]bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:libtool:
    /usr/bin/libtool /usr/share/libtool /usr/share/man/man1/libtool.1.gz -,
    which is correct.
    Where is $JAVA_HOME set or how do I add it to the path permanently?

You have to set it yourself.

Options include /etc/bashrc, /etc/profile, /etc/profile.d,
/etc/environment, /etc/environment.d, and possibly others, for setting
it system-wide, and their per-user counterparts in $HOME for setting it
on a per-user basis.

Regards,

-Roberto


Le 23/08/2022 à 15:49, Amn a écrit :
Thank you for your prompt response.
Adding Java to the $PATH variable requires me to know the location where Java was installed, which I don't know. Is there a way to find out where Java was installed?



Maybe this could help :

$ java -version
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Debian-1, mixed mode, sharing)

$ update-alternatives --config java
Il existe 6 choix pour l'alternative java (qui fournit /usr/bin/java).

  Sélection   Chemin Priorité  État
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111      mode automatique   1            /usr/lib/jvm/java-1.5.0-sun/jre/bin/java 53        mode manuel   2            /usr/lib/jvm/java-10-openjdk-amd64/bin/java 1101      mode manuel * 3            /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111      mode manuel
  4            /usr/lib/jvm/java-6-sun/jre/bin/java 63        mode manuel
  5            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081      mode manuel   6            /usr/lib/jvm/oracle-java8-jdk-amd64/jre/bin/java 318       mode manuel

Appuyez sur <Entrée> pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionné :

(Sorry, it's french)

Rudu



Reply to: