Arch installs eclipse Jee and configures tomcat - Dynamic Web Project

text

Software engineering needs to use jsp to develop and write websites. The teacher's PPT requires SVN, Tomcat and MyEclipse. Svn is a centralized version controller. I plan to replace it with Git. It is said that Tomcat can be replaced with Nginx, and I will try again later; There are many cracked versions of MyEclipse on the Internet, but I want to use an Eclipse, so I checked the Eclipse installed and developed jsp on Arch Linux. After a long time, I finally installed it. I also found that there is no dynamic web project I want in the new project, and there are still no images and plug-ins. Finally, I checked again to know that the dynamic website engineering development should install Eclipse Jee, not Eclipse jsp.

My environment

$ screenfetch
                   -`                 
                  .o+`                 kearney@arch
                 `ooo/                 OS: Arch Linux 
                `+oooo:                Kernel: x86_64 Linux 5.12.5-arch1-1
               `+oooooo:               Uptime: 7m
               -+oooooo+:              Packages: 1412
             `/:-:++oooo+:             Shell: bash
            `/++++/+++++++:            Resolution: 2560x1440
           `/++++++++++++++:           DE: KDE 5.82.0 / Plasma 5.21.5
          `/+++ooooooooooooo/`         WM: KWin
         ./ooosssso++osssssso+`        GTK Theme: Breeze [GTK2/3]
        .oossssso-````/ossssss+`       Icon Theme: bloom-classic
       -osssssso.      :ssssssso.      Disk: 42G / 116G (38%)
      :osssssss/        osssso+++.     CPU: AMD Ryzen 5 4600U with Radeon Graphics @ 12x 2.1GHz
     /ossssssss/        +ssssooo/-     GPU: AMD/ATI
   `/ossssso+/:-        -:/+osssso+-   RAM: 3387215872-
  `+sso+:-`                 `.-/+oso: 
 `++:.                           `-/+/
 .`                                 `/

Tomcat

sudo pacman -S tomcat7
# Start tomcat service at http://localhost:8080/ , the surface can be browsed normally, and the installation is successful
sudo systemctl start tomcat7

# Delete comments, set passwords and roles
sudo nano /usr/share/tomcat7/conf/tomcat-users.xml

sudo systemctl restart tomcat7

The modified user configuration file (Tomcat users. XML) will probably look like this. Please help yourself with the password. The main reason is that the role can be managed by users with manager GUI. Of course, admin GUI is the most advanced management role.

<?xml version="1.0" encoding="UTF-8"?>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="121A=-1:*56" roles="tomcat"/>
  <user username="both" password="^SX3U456" roles="tomcat,role1,manager-gui,admin-gui"/>
  <user username="kearney" password="1a$2v^5*(6" roles="role1"/>
</tomcat-users>

File system organization level

  • /var/lib/tomcat7/webapps/ROOT / default URL and directory

yay install eclipse JSP

I saw many posts about downloading with pacman. I tried and couldn't find the target. After reading the Arch Wiki, I found that the eclipse package has been transferred to AUR. And it is subdivided into 6 different languages. For the packages, it is also marked below that it does not support the installation of several different eclipse at the same time. There is a conflict

yay -S eclipse-javascript

But why did you download all of them??? I can understand the next java, but I downloaded CPP, PHP and trust. What's the whole thing???

After self verification in this way, I found that it was a waste of time (nearly 40 mins) and traffic. I downloaded all versions of eclipse and then cleaned it up. I still didn't understand the second lengzi operation because I didn't practice enough..

# View yay version
$ yay -V
yay v10.1.2 - libalpm v12.0.2
# Schematic diagram of installation process record
$ yay -S eclipse-javascript
:: Checking for conflicts...
:: Checking for internal conflicts...
[Aur:1]  eclipse-2:4.18-2 (eclipse-javascript)

  1 eclipse (eclipse-javascript)             (Build file already exists)
==> Which software package builds are cleaned up?
==> [N]No, [A]whole [Ab]suspension [I]already installed [No]Not installed or (1 2 3, 1-3, ^4)
==> N
:: PKGBUILD It's up to date. Skip (1/1): eclipse (eclipse-javascript)
  1 eclipse (eclipse-javascript)             (Build file already exists)
==> What are the differences?
==> [N]No, [A]whole [Ab]suspension [I]already installed [No]Not installed or (1 2 3, 1-3, ^4)
==> N
:: (1/1) Parsing SRCINFO: eclipse (eclipse-javascript)
==> Creating package: eclipse 2:4.18-2 (2021 Monday, May 24, 2008 08:24:21)
==> Get source code...
  -> find commonify
  -> find eclipse-java-2020-12-R-linux-gtk-x86_64.tar.gz
  -> Downloading eclipse-jee-2020-12-R-linux-gtk-x86_64.tar.gz...
** Resuming transfer from byte position 5976064
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  494M  100  494M    0     0   739k      0  0:11:25  0:11:25 --:--:--  727k
  -> Downloading eclipse-cpp-2020-12-R-linux-gtk-x86_64.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  358M  100  358M    0     0   616k      0  0:09:55  0:09:55 --:--:--  806k
  -> Downloading eclipse-php-2020-12-R-linux-gtk-x86_64.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  246M  100  246M    0     0   668k      0  0:06:16  0:06:16 --:--:--  806k
  -> Downloading eclipse-javascript-2020-12-R-linux-gtk-x86_64.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  304M  100  304M    0     0   577k      0  0:09:00  0:09:00 --:--:-- 1459k
  -> Downloading eclipse-rust-2020-12-R-linux-gtk-x86_64.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  266M  100  266M    0     0   635k      0  0:07:09  0:07:09 --:--:--  639k
==> Validating source File, use sha256sums...
    commonify ... adopt
==> Validating source_x86_64 Files, using sha256sums...
    eclipse-java-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-jee-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-cpp-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-php-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-javascript-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-rust-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
==> Creating package: eclipse 2:4.18-2 (2021 Monday, May 24, 2009 09:08:17)
==> Checking runtime dependencies...
==> Checking compile time dependencies
==> Get source code...
  -> find commonify
  -> find eclipse-java-2020-12-R-linux-gtk-x86_64.tar.gz
  -> find eclipse-jee-2020-12-R-linux-gtk-x86_64.tar.gz
  -> find eclipse-cpp-2020-12-R-linux-gtk-x86_64.tar.gz
  -> find eclipse-php-2020-12-R-linux-gtk-x86_64.tar.gz
  -> find eclipse-javascript-2020-12-R-linux-gtk-x86_64.tar.gz
  -> find eclipse-rust-2020-12-R-linux-gtk-x86_64.tar.gz
==> Validating source Files, using sha256sums...
    commonify ... adopt
==> Validating source_x86_64 Files, using sha256sums...
    eclipse-java-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-jee-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-cpp-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-php-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-javascript-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
    eclipse-rust-2020-12-R-linux-gtk-x86_64.tar.gz ... adopt
==> Deleting existing $srcdir/ catalogue...
==> Releasing source code...
==> Starting prepare()...
==> The source code is ready.
==> Creating package: eclipse 2:4.18-2 (2021 Monday, May 24, 2009 09:08:41)
==> Checking runtime dependencies...
==> Checking compile time dependencies
==> Warning: use existing $srcdir/ tree
==> Starting build()...
==> Entering fakeroot environment...
==> Starting package_eclipse-java()...
==> Cleaning up installation...
  -> Deleting libtool file...
  -> Cleaning up unwanted files...
  -> Removing static library files...
  -> Cleaning up unwanted system symbols from binaries and libraries...
  -> Compressing man and info file...
==> Checking for packaging issues...
==> Building package"eclipse-java"...
  -> Building .PKGINFO file...
  -> Building .BUILDINFO file...
  -> Building .MTREE file...
  -> Compressing package...
==> Starting package_eclipse-jee()...
==> Cleaning up installation...
  -> Deleting libtool file...
  -> Cleaning up unwanted files...
  -> Removing static library files...
  -> Cleaning up unwanted system symbols from binaries and libraries...
  -> Compressing man and info file...
==> Checking for packaging issues...
==> Building package"eclipse-jee"...
  -> Building .PKGINFO file...
  -> Building .BUILDINFO file...
  -> Building .MTREE file...
  -> Compressing package...
==> Starting package_eclipse-cpp()...
==> Cleaning up installation...
  -> Deleting libtool file...
  -> Cleaning up unwanted files...
  -> Removing static library files...
  -> Cleaning up unwanted system symbols from binaries and libraries...
  -> Compressing man and info file...
==> Checking for packaging issues...
==> Building package"eclipse-cpp"...
  -> Building .PKGINFO file...
  -> Building .BUILDINFO file...
  -> Building .MTREE file...
  -> Compressing package...
==> Starting package_eclipse-php()...
==> Cleaning up installation...
  -> Deleting libtool file...
  -> Cleaning up unwanted files...
  -> Removing static library files...
  -> Cleaning up unwanted system symbols from binaries and libraries...
  -> Compressing man and info file...
==> Checking for packaging issues...
==> Building package"eclipse-php"...
  -> Building .PKGINFO file...
  -> Building .BUILDINFO file...
  -> Building .MTREE file...
  -> Compressing package...
==> Starting package_eclipse-javascript()...
==> Cleaning up installation...
  -> Deleting libtool file...
  -> Cleaning up unwanted files...
  -> Removing static library files...
  -> Cleaning up unwanted system symbols from binaries and libraries...
  -> Compressing man and info file...
==> Checking for packaging issues...
==> Building package"eclipse-javascript"...
  -> Building .PKGINFO file...
  -> Building .BUILDINFO file...
  -> Building .MTREE file...
  -> Compressing package...
==> Starting package_eclipse-rust()...
==> Cleaning up installation...
  -> Deleting libtool file...
  -> Cleaning up unwanted files...
  -> Removing static library files...
  -> Cleaning up unwanted system symbols from binaries and libraries...
  -> Compressing man and info file...
==> Checking for packaging issues...
==> Building package"eclipse-rust"...
  -> Building .PKGINFO file...
  -> Building .BUILDINFO file...
  -> Building .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment
==> Finish creating: eclipse 2:4.18-2 (2021 Monday, May 24, 2009 09:19:15)
==> Cleaning up...

Loading package...
Resolving dependencies...
Looking for package conflicts...

software package (1) eclipse-javascript-2:4.18-2

Full installation size: 443.90 MiB

:: Install? [Y/n] 
(1/1) Checking the key in the key ring                                       [####################################] 100%
(1/1) Checking package integrity                                         [####################################] 100%
(1/1) Loading package file                                           [####################################] 100%
(1/1) Checking for file conflicts                                             [####################################] 100%
(1/1) Checking available storage space                                         [####################################] 100%
:: Processing package changes...
(1/1) Installing eclipse-javascript                                  [####################################] 100%
:: Running post transaction hook function...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating icon theme caches...
(3/3) Updating the desktop file MIME type cache...

After installation, you can really start editing jsp files and later change the plug-in of image jsp, but there is still no dynamic web project required by the course and Tomcat in the setting (installed).

uninstall

$ yay -Rs eclipse-javascript
 Checking dependencies...
:: wxgtk3 Optional dependent on webkit2gtk: for webview support

software package (9) java-environment-common-3-3  jdk-openjdk-15.0.2.u7-1  libmanette-0.2.6-2
           libwpe-1.10.0-1  unzip-6.0-14  webkit2gtk-2.32.1-1  wpebackend-fdo-1.9.92-1
           xdg-dbus-proxy-0.1.2-3  eclipse-javascript-2:4.18-2

Total removed volume: 632.35 MiB

Then delete the in the user directory Eclipse, after a while, I found that the above step accidentally deleted other packages. Originally, only eclipse-javascript-2:4.18-2 should be deleted. The correct unloading method is yay - R eclipse JavaScript

remedy

Later, I found that java was gone... Looking back, I accidentally uninstalled the above. Although I don't know what the others are, I'd better supplement them. (my arch scrolled to the latest version a few days ago, so the remedial installation doesn't bring the version number. If yours is not the latest, it's better to bring the version number.)

sudo pacman -S java-environment-common jdk-openjdk libmanette libwpe unzip webkit2gtk wpebackend-fdo xdg-dbus-proxy

tar installation

Download installation package

Eclipse IDE 2021-03 R Packages : after selecting the version of, you can select a closer image, and the download speed will fly up. I downloaded the Eclipse IDE for Enterprise Java and Web Developers (519 M). Select the TUNA image next door and download eclipse-jee-2021-03-R-linux-gtk-x86_64.tar.gz.

Document integrity verification

Download the file from the place just now. For example, I downloaded eclipse-jee-2021-03-R-linux-gtk-x86_64.tar.gz.md5. Of course, you can also download other check codes (sha1, sha512)

Dolphin, KDE's own file manager, has a good function. The right-click file attribute has a checksum function. It can be calculated and pasted for verification.

The following is the schematic diagram of command line verification method

# md5 verification
$ md5sum eclipse-jee-2021-03-R-linux-gtk-x86_64.tar.gz
8428cf7b84b2c2988678f93250fc85a6  eclipse-jee-2021-03-R-linux-gtk-x86_64.tar.gz
# sha1 verification
$ shasum eclipse-jee-2021-03-R-linux-gtk-x86_64.tar.gz
a757f27a65587a8e61335d49725a672cf3e703ea  eclipse-jee-2021-03-R-linux-gtk-x86_64.tar.gz

install

cd ~/Downloads
sudo mv eclipse-jee-2021-03-R-linux-gtk-x86_64.tar.gz /opt/
cd /opt
sudo tar -zxvf eclipse-jee-2021-03-R-linux-gtk-x86_64.tar.gz
# Delete compressed package
sudo rm eclipse-jee-2021-03-R-linux-gtk-x86_64.tar.gz

However, when using the ls command, you can see that the eclipse installer package is not generated at all. Instead, you can directly create an eclipse folder. I found an executable file called eclipse. Double click it to open the IDE of eclipse Jee. The problem is the lack of a shortcut to start.

cd eclipse
./eclipse

Desktop shortcut

cd /usr/share/applications/
sudo nano org.eclipse.desktop

Paste these contents inside, save and exit nano, so you can find it by opening the "tools" or "development" column in the menu.

[Desktop Entry]
Name=Eclipse
Comment=Eclipse IDE For JEE
Exec=/opt/eclipse/eclipse
Icon=/opt/eclipse/icon.xpm
Type=Application
StartupNotify=true
Categories=Utility;Development;IDE;
Keywords=eclipse;

Configure tomcat7

Tomcat installed by pacman can work normally, and the files written in the root directory of the default website can also be accessed normally. However, adding tomcat7 in eclipse reported an error and failed to load its configuration file normally. Many attempts have been made on the Internet, but they have failed: adding dynamic link files, deleting two files in eclipse workspace (I don't have them here), and service Misspelling in XML, reloading tomcat7, configuring jre, deleting and adding again...

After checking the versions of tomcat7 and java, they are all compatible and have no problem. I didn't want to understand what the problem is. Then I tried to install tomcat7 with eclipse. I failed to install it under / opt, and failed to install it with root permission. Finally, I changed my directory (/ home/kearney/app/tomcat7 /) and successfully installed it.

Looking at tomcat7 installed through eclipse, I found that its directory structure is all in one path. Unlike tomcat7 installed through pacman, various files are distributed in different places. Therefore, the best answer on the Internet is to use dynamic link. After trying dynamic link several times, it failed (there is a conf dynamic link). I don't know the reason for this failure, But fortunately, a solution has been found.

Although you can't install it in eclipse under / opt /, you can't run eclipse with sudo. So first install it in your own directory, you can configure the running environment normally, and then try to copy it to / opt /, which is also OK after testing. Save the in your own directory for a backup and delete it after a while. Of course, it's no problem to always use those in your own directory. You don't have to move them to / opt /. It's just a personal habit.

cd /home/kearney/app/tomcat7/
sudo cp -r apache-tomcat-7.0.47/ /opt/apache-tomcat-7.0.47/

reference resources

Tomcat Arch Wiki

Eclipse Arch Wiki

Eclipse IDE 2021-03 R Packages : (2021-03 is the latest stable version on 2021-05, not necessarily in the future)

TUNA image of download address of each version of Eclipse : M1 and M2 are unstable versions (test and development). The directory structure is not very good to understand.

Eclipse IDE for Enterprise Java and Web Developers : 249M. You are not free to choose a mirror image! The orange download button on the right is very misleading (click to download the Eclipse IDE instead of the eclipse Jee being displayed). The real download link is in the middle of the humble position Download Links

Eclipse jee download, providing a mirror point of domestic Tsinghua University to download a piece of waste people 2020-02-27

[Ubuntu Linux] whole process of installing eclipse Xiaomei chongchong 2021-03-29 : I didn't see eclipse installer

Install Eclipse and Java cherrison under Linux_ Time 2019-9 : I don't have eclipse installer; Shortcut tutorial

End

Keywords: Java Linux ArchLinux Eclipse study

Added by cbullock on Tue, 08 Feb 2022 06:16:44 +0200