ubuntu install eclipse+jdk1.7+jdk1.8 environment configuration

Preface

Run the jdk related environment configuration of simfix, and summarize the related problems encountered in the process:

1. Resource preparation

First install eclipse, omit the steps here, and then download the required jdk version on the official website or other sources (the official website is too slow and requires an account, so the jdk1.8 downloaded on the Huawei source, the corresponding jdk1.7 downloaded in the following reference link )
[Note: When downloading from the eclipse official website, pay attention to change the source, tuna or Neusoft, the speed is very fast~]

JDK1.7
https://blog.csdn.net/qq_42295733/article/details/87453719
JDK1.8
Huawei mirror site (choose the corresponding version, much faster than the official website)
https://repo.huaweicloud.com/java/jdk /

2. Configuration process

Although there are installation tutorials from the big cows, there are still different problems in the specific installation. Here is a memorandum

jdk environment variables

Refer to https://blog.csdn.net/rflyee/article/details/8989663
(The process is basically similar to the following)

1. Download the corresponding version of jdk, unzip and move to /usr/lib/jvm (if there is no jvm folder, create a new one)
2. Configure environment variables

Terminal input
sudo gedit /etc/profile

orsudo gedit /etc/bash.bashrc

Add configuration at the end (take jdk1.8 as an example)
#set jdk1.8.0 environment
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_201
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
Update configuration to take effect
source /etc/profile

If you also change bash: source /etc/bash.bashrc

After changing the bash, open the terminal and you can run java in any place. I only changed the profile and found that the installed java could not be found after reopening the terminal... So although I don't know the reason, I changed both places. . . )

Check whether the configuration is successful
java -version

If it shows as follows, it is successful

java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

If not, establish a soft connection first:

sudo update-alternatives --install /usr/lib/java java /usr/lib/jvm/jdk1.8.0_201/bin/java 300
sudo update-alternatives --install /usr/lib/javac javac /usr/lib/jvm/jdk1.8.0_201/bin/javac 300

Execute the command to configure the default version from the listed jdk versions:

sudo update-alternatives --config java

The configuration jdk part is over~~

3. Summary of the problem

The eclipse software cannot find the jre path error

Because eclipse was installed first, there was no jdk support at the beginning, so the installed eclipse could not be opened, lack of jre error. .
After installing the two jdk according to the above process, still can't open eclipse, report a long string of letters wrong, don’t worry, probably because simfix requires jdk1.7, and the minimum version required by eclipse is jdk1.8
. : Just add the jre path of jdk1.8 to the beginning of the eclipse.ini file~:
Open /opt/eclipse/eclipse.ini (located in the eclipse installation path) and
add:

-vm
安装的jdk路径+/jre/java
Change jdk1.8 to 1.7 in eclipse to run simfix

As mentioned above, simfix requires jdk1.7, and the minimum version required by eclipse is jdk1.8, you can start eclipse with jre of jdk1.8 first, and then change the jdk version when importing the project

simfix configuration reference

https://blog.csdn.net/qq_42295733/article/details/87453719

Thanks

Thanks to the big cows who provided help during the installation process, let Ben Xiaobai solve many problems during the installation process~~ It
is not the first time to configure this environment without regard to the order of links , but every time the configuration is completed, it does not take a long time to record. The next configuration is again problematic. . Therefore, this installation process is recorded, and it saves time to search for information again

Thank you Mr. R for remotely cleaning up the mess for Ben Xiaobai this evening, the reason for debugging errors, and reminding me to learn to record! ! A word to wake up the person in the dream, if it weren’t for him next time, even if I encounter the same problem next time, I might still be at a loss==

Valentine's Day is approaching, I wish everyone who has lovers will finally get married, and object-oriented as soon as possible! !

Guess you like

Origin blog.csdn.net/qq_38879305/article/details/104292946