Last Modified 2024.7.18

Java Development Environment on Ubutnu 24.04

How to install Oracle 11g XE on Ubuntu

Ubuntu is not a Linux distribution officially supported by Oracle.

You can install Oracle 11g XE on Ubuntu with a few tricks.
Origin: http://meandmyubuntulinux.blogspot.kr/2012/05/installing-oracle-11g-r2-express.html

Visit https://www.oracle.com/database/technologies/xe-prior-release-downloads.html. For 64-bit systems, choose Oracle Database Express Edition 11g Release 2 for Linux x64. You need to log in to download the file. --Sign up if you are not a member of the Oracle website-- When you log in to the site, the download begins. After downloading, go to the directory where the file exists and execute the following command.

unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
sudo apt install alien unixodbc
sudo apt install libaio1
sudo apt install libaio1 fails in Ubuntu 24.04
Ubuntu 24.04 does not support libaio1.
Install libaio-dev instead.
sudo apt install libaio-dev
Oracle 11g XE still expecting libaio.so.1, so create the following symbolic link:
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
cd Disk1
sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm

Create a /sbin/chkconfig file.

sudo nano /sbin/chkconfig

Copy and Paste the following into the file.

#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01

Save the above file and provide appropriate execute privilege.

sudo chmod 755 /sbin/chkconfig

Set the Kernel parameters.

sudo nano /etc/sysctl.d/60-oracle.conf

Copy the following. Paste it into the file.

# Oracle 11g XE kernel parameters  
fs.file-max=6815744  
net.ipv4.ip_local_port_range=9000 65000  
kernel.sem=250 32000 100 128 
kernel.shmmax=536870912

Check the swap memory.

free -m
total       used       free     shared    buffers     cached
Mem:          3942       3809        133        947         50       1571
-/+ buffers/cache:       2186       1756
Swap:         4083        378       3705

Unlike the above, if Swap doesn't exceed 4000, do the following.

sudo ln -s /usr/bin/awk /bin/awk
sudo mkdir /var/lock/subsys
sudo touch /var/lock/subsys/listener

Verify the kernel parameters.

sudo cat /etc/sysctl.d/60-oracle.conf

Load kernel parameters.

sudo service procps restart

Verify.
(In my case, it came out differently from the set value, but I was able to complete the installation)

sudo sysctl -q fs.file-max

Go to the Disk1 directory and run the following commands:

sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb
sudo /etc/init.d/oracle-xe configure
  • Specify the HTTP port that will be used for Oracle Application Express: Set a value other than 8080, like 9090
  • Specify a port the database listener: (just hit Enter)
  • Set passwords for administrator accounts SYS and SYSTEM: Password for Oracle administrators, you specified
  • Do you want Oracle Database 11g Express Edition to be started on boot: (just hit Enter)
Oracle Database 11g Express Edition Configuration
-------------------------------------------------
This will configure on-boot properties of Oracle Database 11g Express 
Edition.  The following questions will determine whether the database 
should be starting upon system boot, the ports it will use, and 
the passwords that will be used for database accounts.  
Press Enter to accept the defaults. 
Ctrl-C will abort.

Specify the HTTP port that will be used 
	for Oracle Application Express [8080]:9090

Specify a port that will be used for the database listener [1521]:

Specify a password to be used for database accounts.
Note that the same password will be used for SYS and SYSTEM.
Oracle recommends the use of different passwords 
for each database account.
This can be done after 
initial configuration: **********
Confirm the password: **********

Do you want Oracle Database 11g Express Edition to be started 
on boot (y/n) [y]:

Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.

Set up the environmental variables.

nano ~/.bashrc

Add the following lines to your .bashrc:

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH

Execute the following command to load the changes:

source ~/.bashrc

Start the Oracle.

sudo service oracle-xe start

SCOTT Account

Log in as an SYS account and run the SCOTT account schema script.

sqlplus sys as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Mon Jun 29 12:04:33 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Enter password: **********

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> @/u01/app/oracle/product/11.2.0/xe/rdbms/admin/utlsampl.sql

Java Install

sudo apt install default-jdk

Maven Install

sudo apt install maven

Git Install

sudo apt install git
git config --global user.name "John Doe"
git config --global user.email johndoe@gmail.org
git config --global --list

gh install

sudo apt install gh

After logging in to the https://github.com, run the following.

gh auth login

Select as shown below.

? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser

Once you make your selection, your one-time password will be added to the screen.

! First copy your one-time code: <one-time code>
- Press Enter to open github.com in your browser...

After copying the password and pressing Enter, the web browser will display a page where you can enter the password.
Paste the password copied from the terminal into the page.

Vim install

sudo apt install vim

Tomcat Install

sudo apt install tomcat10 tomcat10-admin
sudo vi /etc/tomcat10/tomcat-users.xml
<user username="username" password="password" roles="manager-gui" />

File upload directory and log directory

cd /opt
sudo mkdir logs
sudo mkdir upload
sudo chown -R tomcat:tomcat upload/ logs/
sudo chmod u=rwX,g=rwX,o=rX upload/
sudo vi /etc/systemd/system/multi-user.target.wants/tomcat10.service
# Security
User=tomcat
Group=tomcat
PrivateTmp=yes
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
CacheDirectory=tomcat10
CacheDirectoryMode=750
ProtectSystem=strict
ReadWritePaths=/etc/tomcat10/Catalina/
ReadWritePaths=/var/lib/tomcat10/webapps/
ReadWritePaths=/var/log/tomcat10/
ReadWritePaths=/opt/logs/
ReadWritePaths=/opt/upload/
sudo systemctl daemon-reload
sudo service tomcat10 restart

Tomcat logs

sudo passwd

Run su and enter the root account password.

su
Password:

Log in to the root account and run the following command:

tail -f /var/lib/tomcat10/logs/localhost.2024-07-05.log
tail -f /var/lib/tomcat10/logs/catalina.2024-07-05.log

Eclipse Install

Download the installer from https://www.eclipse.org/downloads/ and run the following commands in sequence.

cd Downloads
tar -xvf eclipse-inst-linux64.tar.gz
cd eclipse-installer/
./eclipse-inst

In the installation selection screen, select Eclipse IDE for Enterprise Java Developers.

Eclipse IDE for Enterprise Java Developers

Create eclipse.desktop

cd /usr/share/applications
sudo vi eclipse.desktop

Edit eclipse.desktop file as follows.

[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/home/javaschool/eclipse/jee-2024-06/eclipse/eclipse
Terminal=false
Icon=/home/javaschool/eclipse/jee-2024-06/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE
Name[en]=eclipse.desktop

Customize the paths for Exec and Icon.

Search for eclipse, run it, and pin it to the launcher.

Related Articles