Java installation issues on Ubuntu

后端 未结 7 1160
时光取名叫无心
时光取名叫无心 2021-01-19 02:46

Trying to install Java (JDK 6) on my new Ubuntu system and getting some bizarro errors. This is my first time ever using any flavor of Linux and so I\'m sure it\'s

7条回答
  •  盖世英雄少女心
    2021-01-19 03:10

    Was I wrong to try and make /opt/java my Java directory?

    Not really. Many Java developers install multiple JDK installations and always use /opt/jdk1.6.0_23 or similar paths. The bin file you downloaded is not an installer, but merely an extractor. It does not install the java binaries into system folders like /bin.

    I usually download the JDK and execute it from within my home folder and afterwards move it to /opt and performing an chown.

    Did I run the wrong commands?

    Not really. In case you wanted to install a separate JDK, you did it correctly. In case you wanted system integration, you would be better off to use the distribution-specific packages, such as the one installed via aptitude install sun-java6-jdk or alike.

    The bin you downloaded is imho more flexible, since I can use it to install multiple verisons of Java on the same system. I know this is something you don't often do on Linux machines.

    If you want to use the java binary on command line, you'd have to manually set up the PATH and JAVA_HOME environment variables. I think on Ubuntu that's /etc/environment or /etc/profile or something like that.

    Is Java 1.6.0_23 even installed on my machine?

    Not really. See above answers.

    What are all those gcj-xxx-headless targets?!?

    The GCJ is the Gnu Compiler for Java. Obviously, it includes a Java Development Kit and a Java Runtime Environment.

提交回复
热议问题