Skip to content

Commit

Permalink
READMEのJavaセットアップ手順を修正して、スクリプトに分離 #19
Browse files Browse the repository at this point in the history
  • Loading branch information
jiro4989 committed Nov 24, 2021
1 parent 5d34514 commit 8289112
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
17 changes: 6 additions & 11 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -264,23 +264,18 @@ GPL-2.0

=== 前提条件

* Java 14
* Java 16
* Ubuntu 20.04

環境変数JAVA_HOMEも設定すること。
以下のコマンドでUbuntuでは環境が整う。
以下のインストールスクリプトを実行すると環境が整う。

[source,bash]
----
curl -O https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz
tar xvf openjdk-14_linux-x64_bin.tar.gz
mkdir -p /opt/java
mv jdk-14 /opt/java/
ln -sfn /opt/java/jdk-14 /opt/java/current
export JAVA_HOME=/opt/java/current
./script/install_java.sh
----

実行したら環境変数 `JAVA_HOME` を設定すること。

=== ビルド手順

以下のコマンドを実行する。
Expand Down
14 changes: 14 additions & 0 deletions script/install_java.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -eux

curl -O https://download.java.net/java/GA/jdk16.0.1/7147401fd7354114ac51ef3e1328291f/9/GPL/openjdk-16.0.1_linux-x64_bin.tar.gz

java_version=16
tar xvf openjdk-${java_version}_linux-x64_bin.tar.gz

mkdir -p /opt/java
mv jdk-${java_version} /opt/java/
ln -sfn /opt/java/jdk-${java_version} /opt/java/current

echo '[INFO] set "export JAVA_HOME=/opt/java/current" to your .bashrc or .zshrc or config.fish'

0 comments on commit 8289112

Please sign in to comment.