Skip to content

Commit 5743d92

Browse files
authored
Merge pull request #89 from akatesmith/azurehostedcontent
java on rhel and sles
2 parents 8dc02f5 + b20e5c7 commit 5743d92

File tree

2 files changed

+44
-64
lines changed

2 files changed

+44
-64
lines changed

pages/java/redhat/az/az-java-rhel-1.md

Lines changed: 22 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,70 +19,48 @@ redirect_from:
1919
If you already have Java installed on your machine, skip the next two steps. Install the Java Runtime Environment (JRE) using the following command.
2020

2121
```terminal
22-
sudo yum install java-1.8.0-openjdk
23-
```
24-
25-
```results
26-
Loaded plugins: langpacks, product-id, search-disabled-repos
27-
Resolving Dependencies
28-
--> Running transaction check
29-
---> Package java-1.8.0-openjdk.x86_64 1:1.8.0.111-2.b15.el7_3 will be installed
30-
--> Processing Dependency: java-1.8.0-openjdk-headless = 1:1.8.0.111-2.b15.el7_3
31-
for package: 1:java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64
32-
--> Processing Dependency: fontconfig(x86-64) for package: 1:java-1.8.0-openjdk-
33-
1.8.0.111-2.b15.el7_3.x86_64
34-
--> Processing Dependency: libjava.so(SUNWprivate_1.1)(64bit) for package: 1:jav
35-
a-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64
36-
--> Processing Dependency: libjli.so(SUNWprivate_1.1)(64bit) for package: 1:java
37-
...
38-
Installed:
39-
java-1.8.0-openjdk.x86_64 1:1.8.0.111-2.b15.el7_3
22+
sudo rpm --import http://repos.azul.com/azul-repo.key
23+
sudo curl http://repos.azul.com/azure-only/zulu-azure.repo -o /etc/yum.repos.d/zulu-azure.repo
24+
sudo yum -q -y update
25+
sudo yum -q -y install zulu-11-azure-jdk
4026
```
4127

4228
## Step 1.3 Install Maven
4329

4430
[Maven](https://maven.apache.org/) can be used to help manage dependencies, build, test and run your Java project.
4531

4632
```terminal
47-
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
48-
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
49-
sudo yum install maven
33+
cd /opt
34+
sudo wget https://www-eu.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
35+
sudo tar xzf apache-maven-3.6.3-bin.tar.gz
36+
sudo ln -s apache-maven-3.6.3 maven
5037
```
5138

52-
```results
53-
Loaded plugins: langpacks, product-id, search-disabled-repos
54-
Resolving Dependencies
55-
--> Running transaction check
56-
---> Package maven.noarch 0:3.0.5-17.el7 will be installed
57-
--> Processing Dependency: aether-api for package: maven-3.0.5-17.el7.noarch
58-
--> Processing Dependency: aether-connector-wagon for package: maven-3.0.5-17.el7.noarch
59-
--> Processing Dependency: aether-impl for package: maven-3.0.5-17.el7.noarch
60-
--> Processing Dependency: aether-spi for package: maven-3.0.5-17.el7.noarch
61-
--> Processing Dependency: aether-util for package: maven-3.0.5-17.el7.noarch
62-
...
63-
Installed:
64-
maven.noarch 0:3.0.5-17.el7
39+
40+
Now, create a maven.sh file in /etc/profile.d/maven.sh, and put the following into it:
41+
42+
```terminal
43+
export M2_HOME=/opt/maven
44+
export PATH=${M2_HOME}/bin:${PATH}
6545
```
6646

67-
Check that you have Maven properly installed by running the following command.
47+
Load the file, and check the maven version:
6848

6949
```terminal
50+
source /etc/profile.d/maven.sh
7051
mvn -v
7152
```
7253

7354
```results
74-
Apache Maven 3.0.5 (Red Hat 3.0.5-17)
75-
Maven home: /usr/share/maven
76-
Java version: 1.8.0_111, vendor: Oracle Corporation
77-
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre
55+
56+
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
57+
Maven home: /opt/maven
58+
Java version: 11.0.7, vendor: Azul Systems, Inc., runtime: /usr/lib/jvm/zulu-11-azure
7859
Default locale: en_US, platform encoding: UTF-8
79-
OS name: "linux", version: "3.10.0-327.36.3.el7.x86_64", arch: "amd64", family: "unix"
60+
OS name: "linux", version: "4.18.0-193.el8.x86_64", arch: "amd64", family: "unix"
8061
```
8162

8263
Note: If you're using an older version of Java, such as 1.7, your results above may differ slightly. If you want to use an updated version of Java, please update your Java home variable.
8364

84-
## Step 1.4 Install The Azure CLI and Login to Azure
85-
86-
{% include partials/download_azure_cli.md %}
8765

88-
> You have successfully installed Java and Maven on your Mac, and authenticated to Azure. You now have everything you need to start writing your Java apps with Azure SQL!
66+
> You have successfully installed Java and Maven on your Red Hat machine. You now have everything you need to start writing your Java apps with Azure SQL DB!

pages/java/sles/az/az-java-sles-1.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,44 +20,46 @@ If you already have Java installed on your machine, skip the next two steps. Ins
2020

2121
```terminal
2222
sudo zypper update
23-
sudo zypper install java-1_8_0-openjdk
24-
sudo zypper install java-1_8_0-openjdk-devel
23+
sudo zypper install java-10-openjdk
24+
sudo zypper install java-10-openjdk-devel
2525
```
2626

2727
## Step 1.3 Install Maven
2828

2929
[Maven](https://maven.apache.org/) can be used to help manage dependencies, build, test and run your Java project.
3030

3131
```terminal
32-
sudo zypper addrepo http://download.opensuse.org/repositories/devel:tools:building/SLE_12_SP2/devel:tools:building.repo
33-
sudo zypper refresh
34-
sudo zypper install maven
32+
wget -c https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip
33+
unzip apache-maven-3.6.3-bin.zip
34+
sudo mv apache-maven-3.6.3 /opt/maven
3535
```
3636

37-
```results
38-
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
39-
Maven home: /usr/share/java/maven
40-
Java version: 1.8.0_121, vendor: Oracle Corporation
41-
Java home: /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre
42-
Default locale: en_US, platform encoding: UTF-8
43-
OS name: "linux", version: "4.4.38-93-default", arch: "amd64", family: "unix"
37+
In your favorite text editor, add the following to a new file, maven.sh, in /etc/profile.d/.
38+
39+
```terminal
40+
export M2_HOME=/opt/maven/
41+
export M2=$M2_HOME/bin
42+
export PATH=$M2:$PATH
4443
```
4544

46-
Check that you have Maven properly installed by running the following command.
45+
Next, refresh your terminal session or create a new one, and check your versions:
4746

4847
```terminal
4948
mvn -v
5049
```
5150

51+
5252
```results
53-
Apache Maven 3.0.5 (Red Hat 3.0.5-17)
54-
Maven home: /usr/share/maven
55-
Java version: 1.8.0_111, vendor: Oracle Corporation
56-
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre
57-
Default locale: en_US, platform encoding: UTF-8
58-
OS name: "linux", version: "3.10.0-327.36.3.el7.x86_64", arch: "amd64", family: "unix"
53+
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
54+
Maven home: /opt/maven
55+
Java version: 10.0.2, vendor: Oracle Corporation, runtime: /usr/lib64/jvm/java-10-openjdk-10
56+
Default locale: en, platform encoding: UTF-8
57+
OS name: "linux", version: "4.12.14-8.33-azure", arch: "amd64", family: "unix"
5958
```
6059

60+
Check that you have Maven properly installed by running the following command.
61+
62+
6163
Note: If you're using an older version of Java, such as 1.7, your results above may differ slightly. If you want to use an updated version of Java, please update your Java home variable.
6264

63-
> You have successfully installed Java and Maven on SLES. You now have everything you need to start writing your Java apps with SQL Server!
65+
> You have successfully installed Java and Maven on SLES. You now have everything you need to start writing your Java apps with Azure SQL DB!

0 commit comments

Comments
 (0)