Click here for introduction of AWS cloud9
Click here for articles etc. that were referred to when installing the java development tool
It was easy to understand and was very helpful. Thank you very much.
What to do in this article
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.
Writer: first run (2nd month of programming study. Originally Ruby, first java)
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.
[Let’s see other articles a little more]
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.
From here, install according to the instructions on the AWS official website.
If something unexpected happens on the way, we will google again.
・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
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.
#### [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 -version
java version "1.7.0_181"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (...)
$ javac -version
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.
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:
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 development tool was successfully installed.
The instructions on the AWS official website have the following, but the installation work itself is here.
- Switch the default Java development toolset to OpenJDK 8 or upgrade