[Java] [Beginner] Install java development tool in cloud9 development environment.

3 minute read


Click here for introduction of AWS cloud9 https://qiita.com/tu-kun/items/d7b4f1fa19cc93bc5b75

Click here for articles etc. that were referred to when installing the java development tool https://qiita.com/tu-kun/items/91efb172f7dd7501602e

It was easy to understand and was very helpful. Thank you very much.

What to do in this article

####【Purpose】 Install java development tools to learn java.

  • I am writing about how I am a newcomer and how to research and work. *: Personal excursion. Immediate scrolling recommended.

####【Development environment】 Writer: first run (2nd month of programming study. Originally Ruby, first java) MacBookpro cloud9

Preliminary inspection (until installation work starts)


Go around the installation method. The keyword is “java, cloud9”. Then, some search results came out.

[Anyway, AWS official site]

The one that came out to the top was the official website of AWS, so click. We decided to take a quick look at the contents and basically install along this flow. … before that.

For the time being, I will check the article on installation method other than the official website of AWS. Of course, I’m not suspicious of the AWS official website.

In my case, based on my experience so far, if I had to go ahead with only one article, I would not have had a test that yielded very good results… I learned very well.

Start work

From here, install according to the instructions on the AWS official website. If something unexpected happens on the way, we will google again.

####【Workflow】 ・Prerequisite development environment confirmation ・Check if the java development tool is already installed ・Check if the latest security updates and bug fixes have been installed Install Open JDK, which is a java development tool

  • Switch the default Java development toolset to OpenJDK 8 or upgrade ・Version confirmation
Hmm? Work to switch... At the end of installation? Yes (← I saw the article). After installation, the work of "switching" is waiting. Don't dust early. It's something I often do. </Digression> #### [Confirmed development environment] 1. There is an existing AWS cloud9 EC2 development environment. → YES What is EC2? I'm using cloud9, but I don't understand. That is me. Abbreviation for "Amazon Elastic Compute Cloud" “Elastic”: Elastic and stretchable One of the systems available on AWS. A virtual server can be built. The specifications can be changed according to the needs of the user. 2. There is AWS Cloud9 IDE already open in the existing environment. → YES #### [Check if java development tools are already installed] First, open the cloud9 terminal and execute the following command. ``` $ java -version ``` If the output contains a value starting with Java(TM), Java Runtime Environment, Java SE, J2SE, or Java2 -OpenJDK is not installed · Not set as the default Java development toolset In that case, installation is required. So, when you look at the results after execution... java confirmation ``` $ java -version java version "1.7.0_181" OpenJDK Runtime Environment (...) OpenJDK 64-Bit Server VM (...) ``` javac confirmation ``` $ javac -version javac 1.7.0_181 ``` With this, I was able to safely confirm that it was not installed!! #### [Check if the latest security updates and bug fixes have been installed] Make sure you have the latest security updates and bug fixes installed. Execute the yum tool (for Amazon Linux) or apt tool (for Ubuntu Server) using the update command. ‥ In my case, was it good to use "Amazon linux"? ? Confirm, just in case. ``` $ Cat /proc/version Linux version 4.14.186-110.268.amzn1.x86_64 (...) ``` Yoshi, properly linux. </ digression> Execute yum tool. ``` Sudo yum -y update ``` #### [Install Open JDK, which is a java development tool] Install OpenJDK 8. ``` sudo yum -y install java-1.8.0-openjdk-devel ``` #### [Switch the default Java development toolset to OpenJDK 8 or upgrade] Execute the update-alternatives command using the --config option. First, from java. ``` Sudo update-alternatives --config java ``` Execute this, and at the bottom, ``` * 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java + 2 /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java Enter to keep the current selection[+], or type selection number: ``` Is output. This time, I want to insert "1.8...", so enter "2" after "number:". ``` Enter to keep the current selection[+], or type selection number:2 ``` ‥ Run and complete. Execute javac in the same way #### [Verification of version] ``` java -version javac -version ``` # Done Java development tool was successfully installed. The instructions on the AWS official website have the following, but the installation work itself is here.