0% found this document useful (0 votes)
5 views2 pages

Java Install

Uploaded by

nathsusil66
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Java Install

Uploaded by

nathsusil66
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

Java check
java -version

Output Java 17 ya Java 21

Example:

openjdk version "21.0.x"

Not instal java then-

Ubuntu
sudo apt update
sudo apt install openjdk-21-jdk -y

Check:

java -version

2. Application folder create


sudo mkdir -p /opt/sso-applicant

Jar copy:

sudo cp [Link] /opt/sso-applicant/

3. Service file create


sudo nano /etc/systemd/system/[Link]

Paste:

[Unit]
Description=SSO Applicant Service
After=[Link]

[Service]
Environment="DB_URL=jdbc:postgresql://STAGING_HOST:5432/STAGING_DB"
Environment="DB_USERNAME=staging_user"
Environment="DB_PASSWORD=staging_password"
Environment="API_BASE_URL=[Link]
Environment="SERVER_PORT=9092"

ExecStart=/usr/bin/java -jar /opt/sso-applicant/[Link]

Restart=always

[Install]
WantedBy=[Link]

4. Reload systemd
sudo systemctl daemon-reload

5. Service start
sudo systemctl start sso-applicant

6. Auto-start enable
sudo systemctl enable sso-applicant

7. Status check
sudo systemctl status sso-applicant

Expected:

Active: active (running)

You might also like