In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
When configuring the Oracle JDK development environment, many web tutorials recommend adding environment variables to / etc/profile. However, the virtual terminal gnome-terminal under Fedora does not log in to Shell by default (which can be modified in the configuration) and does not read the configuration file, resulting in the system unable to find JDK.
Now that the oracle-jdk installation package has been added to the community source, the required configuration is greatly simplified.
$sudo dnf install oracle-jdk8 oracle-jdk7
When the package is installed, download JDK from Oracle's official website.
After installation, there are two ways to configure.
Read environment variable configuration file
/ etc/sysconfig/oracle-jdk is a JDK environment variable configuration file, and multiple JDK versions can be added to facilitate switching.
This method is suitable for single-user systems or ordinary users without modifying system configuration files.
Simply add the following command to ~ / .bashrc or ~ / .bash_profile:
# JDK variablestest-f / etc/sysconfig/oracle-jdk & &. / etc/sysconfig/oracle-jdk | |:
The official wiki recommends adding a user-customized environment variable to ~ / .bash_profile, which is loaded only when you start an interactive login Shell.
If you add environment variables to ~ / .bashrc, each time you open a virtual terminal, the configuration is loaded because all interactive Shell loads ~ / .bashrc.
/ etc/sysconfig/oracle-jdk has been restricted, writing ~ / .bashrc will not cause repeated definition of environment variables, resulting in the problem of variable nesting.
Alternatives mechanism
Using alternatives, you can modify the system-level default JDK. This method does not need to set environment variables, but requires root permission, which is more suitable for system global modification.
$sudo alternatives-- config javac # switch jdk* 1 / usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-15.b17.fc23.x86_64/bin/javac + 2 / usr/lib/jvm/jdk1.8.0_66/bin/javac 3 / usr/lib/jvm/jdk1.7.0_80/bin/javac$ sudo alternatives-- config java # switch jre* 1 / usr/lib/jvm/ Java-1.8.0-openjdk-1.8.0.65-15.b17.fc23.x86_64/jre/bin/java + 2 / usr/lib/jvm/jdk1.8.0_66/jre/bin/java 3 / usr/lib/jvm/jdk1.7.0_80/jre/bin/java
Reference address: https://github.com/FZUG/repo/wiki/
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.