diff --git a/swi-install.sh b/swi-install.sh index 6130e1251cd095600ce93a9b9490597fbdb905cc..cc0fc2f953515799484fe4af059f6c7be06b9308 100755 --- a/swi-install.sh +++ b/swi-install.sh @@ -21,14 +21,18 @@ function downloadAndExtract(){ } -#Install ORACLE JAVA 8 and OPEN JDK 11 +#Install ORACLE JAVA 8 and OPEN JDK 11, 16 function installJava(){ echo '============>Install java packages.....===========================================================================================================' sudo apt -y install openjdk-8-jdk - sudo apt -y install openjdk-14-jdk - sudo apt -y install openjdk-14-source - sudo apt -y install openjdk-14-doc + sudo apt -y install openjdk-11-jdk + sudo apt -y install openjdk-11-source + sudo apt -y install openjdk-11-doc + + sudo apt -y install openjdk-16-jdk + sudo apt -y install openjdk-16-source + sudo apt -y install openjdk-16-doc echo '============>Java installed.===========================================================================================================' } @@ -36,15 +40,22 @@ function installJavaFX(){ echo '============>Install java FX.....===========================================================================================================' # sudo apt -y install openjfx - wget https://download2.gluonhq.com/scenebuilder/11.0.0/install/linux/scenebuilder-11.0.0.deb - sudo dpkg -i scenebuilder-11.0.0.deb - rm scenebuilder-11.0.0.deb + wget https://download2.gluonhq.com/scenebuilder/16.0.0/install/linux/SceneBuilder-16.0.0.deb + sudo dpkg -i scenebuilder-16.0.0.deb + rm scenebuilder-16.0.0.deb wget -O openjfx-14.0.2.1_linux-x64_bin-sdk.zip https://download2.gluonhq.com/openjfx/14.0.2.1/openjfx-14.0.2.1_linux-x64_bin-sdk.zip - sudo unzip -d /opt openjfx-14.0.2.1_linux-x64_bin-sdk.zip - rm openjfx-14.0.2.1_linux-x64_bin-sdk.zip + wget -O openjfx-17_linux-x64_bin-sdk.zip https://download2.gluonhq.com/openjfx/17/openjfx-17_linux-x64_bin-sdk.zip + sudo unzip -d /opt openjfx-17_linux-x64_bin-sdk.zip + rm openjfx-17_linux-x64_bin-sdk.zip echo '============>Java FX installed.===========================================================================================================' } +function uninstallJavaFX(){ + echo '============>Uninstalling OpenJFX .....===========================================================================================================' + sudo rm -R /opt/openjfx-* + echo '============>OpenJFX uninstalled===========================================================================================================' +} + #Create menu launcher and alternatives function createLauncher(){ local name=$1 @@ -82,7 +93,8 @@ function removeLauncher(){ function downloadAndExtractEclipse(){ local suffix=$1 local url=$2 - downloadAndExtract /opt eclipse-$suffix.tar.gz eclipse eclipse-$suffix $url + local eclipseSrcDir=${3:-eclipse} + downloadAndExtract /opt eclipse-$suffix.tar.gz $eclipseSrcDir eclipse-$suffix $url } @@ -90,22 +102,26 @@ function installPlugins(){ local suffix=$1 local repos=$2 local plugins=$3 + local altRunName=${4:-eclipse} #install plugins - sudo /opt/eclipse-$suffix/eclipse -application org.eclipse.equinox.p2.director -repository $repos -installIU $plugins + echo $repos + echo $plugins + sudo /opt/eclipse-$suffix/$altRunName -nosplash -application org.eclipse.equinox.p2.director -repository $repos -installIU $plugins } #config workspace and config area function doConfig() { local suffix=$1 - + local altConfigName=${2:-eclipse} + printf -v substituteWorkspace "s/osgi\.instance\.area\.default=@user\.home\/workspace$/osgi\.instance\.area\.default=@user.home\/workspace.$suffix/g" sudo sed -i -e $substituteWorkspace /opt/eclipse-$suffix/configuration/config.ini if ! grep "osgi\.configuration\.area=@user\.home/\.eclipse-$suffix/configuration" /opt/eclipse-$suffix/configuration/config.ini > /dev/null; then printf -v substituteConfig "\$aosgi\.configuration\.area=@user\.home/\.eclipse-$suffix/configuration" sudo sed -i -e $substituteConfig /opt/eclipse-$suffix/configuration/config.ini fi - sudo sed -i '/-Dosgi\.instance\.area\.default=/d' /opt/eclipse-$suffix/eclipse.ini - sudo sed -i '/^-D/i -Doomph.setup.skip=true' /opt/eclipse-$suffix/eclipse.ini + sudo sed -i '/-Dosgi\.instance\.area\.default=/d' /opt/eclipse-$suffix/$altConfigName.ini + sudo sed -i '/^-D/i -Doomph.setup.skip=true' /opt/eclipse-$suffix/$altConfigName.ini } function removeEclipseInstance(){ @@ -124,29 +140,31 @@ function installEclipseInstance(){ local icon=$6 local description=$7 local iconUrl=$8 + local altSrcDirName=${9:-eclipse} + local altRunName=${10:-eclipse} echo '============>Installing eclipse '$suffix' .....===========================================================================================================' - downloadAndExtractEclipse $suffix $url + downloadAndExtractEclipse $suffix $url $altSrcDirName echo '============>Installing eclipse '$suffix' plugins .....===========================================================================================================' - installPlugins $suffix $repos $plugins - doConfig $suffix - if [ -n "$iconUrl" ] ; then + installPlugins $suffix $repos $plugins $altRunName + doConfig $suffix $altRunName + if [[ -n "$iconUrl" && "$iconUrl" != "-" ]] ; then sudo wget -O /opt/eclipse-$suffix/$icon $iconUrl fi if [ ! -f /opt/eclipse-$suffix/eclipse-orig ] ; then - if [ -f /opt/eclipse-$suffix/eclipse ] ; then - sudo mv /opt/eclipse-$suffix/eclipse /opt/eclipse-$suffix/eclipse-orig - cat <<EOF | sudo tee /opt/eclipse-$suffix/eclipse > /dev/null + if [ -f /opt/eclipse-$suffix/$altRunName ] ; then + sudo mv /opt/eclipse-$suffix/$altRunName /opt/eclipse-$suffix/eclipse-orig + cat <<EOF | sudo tee /opt/eclipse-$suffix/$altRunName > /dev/null #!/bin/bash if [ -f /usr/share/maven/bin/student-setup ] ; then /usr/share/maven/bin/student-setup fi /opt/eclipse-$suffix/eclipse-orig EOF - sudo chmod +x /opt/eclipse-$suffix/eclipse + sudo chmod +x /opt/eclipse-$suffix/$altRunName fi fi - createLauncher eclipse-$suffix "$niceName" /opt/eclipse-$suffix/eclipse /opt/eclipse-$suffix/$icon "$description" + createLauncher eclipse-$suffix "$niceName" /opt/eclipse-$suffix/$altRunName /opt/eclipse-$suffix/$icon "$description" echo '============>Eclipse '$suffix' installed.===========================================================================================================' } @@ -158,7 +176,7 @@ function addModule(){ local moduleBin=$5 local xaDSClass=$6 local pattern=${@:7} - local moduleDir=/opt/wildfly-20/modules/system/layers/base/$dir/main + local moduleDir=/opt/wildfly-24/modules/system/layers/base/$dir/main local moduleXmlTmp="" local moduleXml="" local driver="" @@ -191,8 +209,8 @@ function addModule(){ <xa-datasource-class>$xaDSClass<\/xa-datasource-class>\\\\n\ <\/driver>\\\\n\ " - if ! grep -q "<driver name=\"$moduleName\" module=\"$moduleName\">" /opt/wildfly-20/standalone/configuration/standalone.xml; then - sudo sed -i -e "s/<\/drivers>/$driver<\/drivers>/g" /opt/wildfly-20/standalone/configuration/standalone.xml + if ! grep -q "<driver name=\"$moduleName\" module=\"$moduleName\">" /opt/wildfly-24/standalone/configuration/standalone.xml; then + sudo sed -i -e "s/<\/drivers>/$driver<\/drivers>/g" /opt/wildfly-24/standalone/configuration/standalone.xml fi } @@ -207,29 +225,30 @@ if [ ! -d \"\$WILDFLY_DIR\" ]; then mkdir -p \$WILDFLY_DIR/data mkdir -p \$WILDFLY_DIR/deployments mkdir -p \$WILDFLY_DIR/log - cp /opt/wildfly-20/standalone/configuration/* \$WILDFLY_DIR/configuration/ + cp /opt/wildfly-24/standalone/configuration/* \$WILDFLY_DIR/configuration/ fi -/opt/wildfly-20/bin/standalone.sh -Djboss.server.base.dir=\$WILDFLY_DIR -Djboss.server.temp.dir=/tmp/wildfly +/opt/wildfly-24/bin/standalone.sh -Djboss.server.base.dir=\$WILDFLY_DIR -Djboss.server.temp.dir=/tmp/wildfly EOF - sudo chmod +x /opt/wildfly-20/bin/standalone-student.sh + sudo chmod +x /opt/wildfly-24/bin/standalone-student.sh - cat <<EOF | sudo tee /opt/wildfly-20/bin/add-user-student.sh > /dev/null + cat <<EOF | sudo tee /opt/wildfly-24/bin/add-user-student.sh > /dev/null #!/bin/bash WILDFLY_DIR=\$HOME/.wildfly -/opt/wildfly-20/bin/add-user.sh -sc \$WILDFLY_DIR/configuration +/opt/wildfly-24/bin/add-user.sh -sc \$WILDFLY_DIR/configuration EOF - sudo chmod +x /opt/wildfly-20/bin/add-user-student.sh + sudo chmod +x /opt/wildfly-24/bin/add-user-student.sh } function installWildfly(){ echo '============>Installing wildfly .....===========================================================================================================' - downloadAndExtract /opt wildfly-20.0.1.Final.tar.gz wildfly-20.0.1.Final wildfly-20 https://download.jboss.org/wildfly/20.0.1.Final/wildfly-20.0.1.Final.tar.gz + downloadAndExtract /opt wildfly-24.0.1.Final.tar.gz wildfly-24.0.1.Final wildfly-24 https://download.jboss.org/wildfly/24.0.1.Final/wildfly-24.0.1.Final.tar.gz + + addModule https://cdn.mysql.com/Downloads/Connector-J/mysql-connector-java-8.0.26.tar.gz com/mysql 1 com.mysql mysql-connector-java-8.0.26.jar com.mysql.cj.jdbc.MysqlXADataSource *mysql-connector-java-8.0.26.jar - addModule https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.21.tar.gz com/mysql 1 com.mysql mysql-connector-java-8.0.21.jar com.mysql.cj.jdbc.MysqlXADataSource *mysql-connector-java-8.0.21.jar addModule https://www-eu.apache.org/dist//db/derby/db-derby-10.15.2.0/db-derby-10.15.2.0-lib.tar.gz org/apache/derby 2 org.apache.derby derbyclient.jar org.apache.derby.jdbc.ClientXADataSource *derbyclient.jar *derbyLocale* *derbyshared.jar *derbytools.jar - sudo chmod +r /opt/wildfly-20/standalone/configuration/* + sudo chmod +r /opt/wildfly-24/standalone/configuration/* createRunScript echo '============>Wildfly installed===========================================================================================================' } @@ -250,7 +269,7 @@ if [ ! -d \"\$JAVA_DB_DIR\" ]; then mkdir -p \$JAVA_DB_DIR fi cd \$JAVA_DB_DIR -JAVA_HOME=/usr/lib/jvm/java-14-openjdk-amd64 +JAVA_HOME=/usr/lib/jvm/java-16-openjdk-amd64 /opt/db-derby/bin/startNetworkServer -noSecurityManager EOF sudo chmod +x /opt/db-derby/bin/startNetworkServer-student @@ -385,6 +404,7 @@ function uninstallJMeter(){ removeLauncher jmeter } +#deprecated function installTomcat(){ echo '============>Installing TomCat .....===========================================================================================================' downloadAndExtract /opt apache-tomcat-9.0.37.tar.gz apache-tomcat-9.0.37 apache-tomcat-9 http://mirror.hosting90.cz/apache/tomcat/tomcat-9/v9.0.37/bin/apache-tomcat-9.0.37.tar.gz @@ -408,8 +428,8 @@ fi EOF sudo chmod +x /opt/apache-tomcat-9/bin/startup-student.sh - wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.21.tar.gz - sudo tar -xzf mysql-connector-java-8.0.21.tar.gz -C /opt/apache-tomcat-9/lib --strip-components=1 mysql-connector-java-8.0.21/mysql-connector-java-8.0.21.jar + wget https://cdn.mysql.com/Downloads/Connector-J/mysql-connector-java-8.0.26.tar.gz + sudo tar -xzf mysql-connector-java-8.0.26.tar.gz -C /opt/apache-tomcat-9/lib --strip-components=1 mysql-connector-java-8.0.26/mysql-connector-java-8.0.26.jar rm mysql-connector-java-8.0.21.tar.gz wget https://www-eu.apache.org/dist//db/derby/db-derby-10.15.2.0/db-derby-10.15.2.0-lib.tar.gz @@ -426,7 +446,8 @@ function uninstallTomcat(){ function installTomEE(){ echo '============>Installing TomEE .....===========================================================================================================' - downloadAndExtract /opt apache-tomee-8.0.0-M3-plume.tar.gz apache-tomee-plume-8.0.0-M3 apache-tomee-plume-8 https://www-us.apache.org/dist/tomee/tomee-8.0.0-M3/apache-tomee-8.0.0-M3-plume.tar.gz + downloadAndExtract /opt apache-tomee-8.0.0-M7-plume.tar.gz apache-tomee-plume-8.0.0-M7 apache-tomee-plume-8 https://dlcdn.apache.org/tomee/tomee-9.0.0-M7/apache-tomee-9.0.0-M7-plume.tar.gz + setupBase cat <<EOF | sudo tee /etc/profile.d/tomee.sh > /dev/null #create default user setting for tomEE @@ -453,7 +474,7 @@ function uninstallTomEE(){ function installGecko(){ echo '============>Installing GeckoDriver .....===========================================================================================================' - wget https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux64.tar.gz + wget https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz sudo tar -xz -C /usr/bin -f geckodriver-v0.29.0-linux64.tar.gz sudo chown root:root /usr/bin/geckodriver sudo chmod +x /usr/bin/geckodriver @@ -482,7 +503,7 @@ function uninstallNetBeans(){ function installIdea(){ echo '============>Installing Idea IDE .....===========================================================================================================' - downloadAndExtract /opt ideaIC-2020.2.1.tar.gz idea-IC-202.6948.69 idea-IC https://download.jetbrains.com/idea/ideaIC-2020.2.1.tar.gz + downloadAndExtract /opt ideaIC-2021.2.1.tar.gz idea-IC-212.5080.55 idea-IC https://download-cdn.jetbrains.com/idea/ideaIC-2021.2.1.tar.gz createLauncher idea-IC "inteliJ IDEA" /opt/idea-IC/bin/idea.sh /opt/idea-IC/bin/idea.png "inteliJ IDEA Community Edition" echo '============>Idea IDE installed.===========================================================================================================' } @@ -494,6 +515,7 @@ function uninstallIdea(){ echo '============>Idea IDE uninstalled.===========================================================================================================' } +#deprecated function installEclipseSTS(){ downloadAndExtract /opt spring-tool-suite-3.9.5.RELEASE-e4.8.0-linux-gtk-x86_64.tar.gz sts-bundle eclipse-sts https://download.springsource.com/release/STS/3.9.5.RELEASE/dist/e4.8/spring-tool-suite-3.9.5.RELEASE-e4.8.0-linux-gtk-x86_64.tar.gz @@ -509,11 +531,10 @@ function installEclipseSTS(){ function installEclipseJava(){ ######Install Eclipse for JAVA development package - installEclipseInstance java http://mirror.dkm.cz/eclipse/technology/epp/downloads/release/2020-12/R/eclipse-java-2020-12-R-linux-gtk-x86_64.tar.gz \ -"http://download.eclipse.org/releases/2020-12/,\ -https://binaries.sonarsource.com/SonarLint-for-Eclipse/releases/5.6.0.25634/,\ -http://download.eclipse.org/modeling/mdt/papyrus/components/designer/,\ -http://download.eclipse.org/modeling/mdt/papyrus/components/marte/,\ + + installEclipseInstance java https://mirror.dkm.cz/eclipse/technology/epp/downloads/release/2021-06/R/eclipse-java-2021-06-R-linux-gtk-x86_64.tar.gz \ +"http://download.eclipse.org/releases/2021-06/,\ +https://binaries.sonarsource.com/SonarLint-for-Eclipse/releases/6.1.0.36269/,\ http://download.eclipse.org/mylyn/incubator/latest/,\ https://download.eclipse.org/efxclipse/updates-released/3.7.0/site/,\ http://update.eclemma.org/,\ @@ -527,10 +548,8 @@ org.eclipse.wb.core.java.feature.feature.group,\ org.eclipse.wb.swing.feature.feature.group,\ org.eclipse.mylyn_feature.feature.group,\ org.eclipse.mylyn.web.tasks_feature.feature.group,\ -org.eclipse.papyrus.sdk.feature.feature.group,\ org.eclipse.eclemma.feature.feature.group,\ org.sonarlint.eclipse.feature.feature.group,\ -org.eclipse.papyrus.designer.languages.java.feature.feature.group,\ org.sf.feeling.decompiler.feature.group,\ org.sf.feeling.decompiler.cfr.feature.group,\ org.sf.feeling.decompiler.jad.feature.group,\ @@ -539,10 +558,22 @@ org.sf.feeling.decompiler.procyon.feature.group" \ "Eclipse Java" icon.xpm "Eclipse for Java Developers" } +function installEclipsePapyrus(){ + ######Install Eclipse for JAVA development packages + +#https://download.eclipse.org/modeling/mdt/papyrus/updates/releases/2021-03/,\ +org.eclipse.papyrus.designer.languages.java.feature.feature.group,\ + + installEclipseInstance papyrus https://ftp.snt.utwente.nl/pub/software/eclipse/modeling/mdt/papyrus/rcp/2020-12/5.0.0/papyrus-2020-12-5.0.0-linux64.tar.gz \ +"https://download.eclipse.org/modeling/mdt/papyrus/updates/releases/2020-12/" \ +"org.eclipse.papyrus.sdk.feature.feature.group" \ +"Eclipse Papyrus" icon.xpm "Eclipse Papyrus" - Papyrus papyrus +} + function installEclipseEE(){ ######Install Eclipse for EE development package - installEclipseInstance ee http://mirror.dkm.cz/eclipse/technology/epp/downloads/release/2020-12/R/eclipse-jee-2020-12-R-linux-gtk-x86_64.tar.gz \ -"http://download.eclipse.org/releases/2020-12/,\ + installEclipseInstance ee https://ftp.halifax.rwth-aachen.de/eclipse/technology/epp/downloads/release/2021-06/R/eclipse-jee-2021-06-R-linux-gtk-x86_64.tar.gz \ +"http://download.eclipse.org/releases/2021-06/,\ https://binaries.sonarsource.com/SonarLint-for-Eclipse/releases/5.6.0.25634/,\ http://download.jboss.org/jbosstools/photon/stable/updates/,\ https://ecd-plugin.github.io/update/,\ @@ -573,25 +604,26 @@ org.dadacoalition.yedit.feature.feature.group" \ function installVagrant(){ echo '============>Installing Vagrant .....===========================================================================================================' - wget https://releases.hashicorp.com/vagrant/2.2.10/vagrant_2.2.10_x86_64.deb - sudo dpkg -i vagrant_2.2.10_x86_64.deb - rm vagrant_2.2.10_x86_64.deb + wget https://releases.hashicorp.com/vagrant/2.2.18/vagrant_2.2.18_x86_64.deb + sudo dpkg -i vagrant_2.2.18_x86_64.deb + rm vagrant_2.2.18_x86_64.deb echo '============>Vagrant installed.===========================================================================================================' } function installAndroidStudio(){ echo '============>Installing Android Studio .....===========================================================================================================' sudo apt -y install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 - downloadAndExtract /opt android-studio-ide-193.6626763-linux.tar.gz android-studio android-studio-4.0.1 https://r1---sn-2gb7sn7k.gvt1.com/edgedl/android/studio/ide-zips/4.0.1.0/android-studio-ide-193.6626763-linux.tar.gz - sudo wget -O /opt/android-studio-4.0.1/android-studio.svg https://upload.wikimedia.org/wikipedia/commons/3/34/Android_Studio_icon.svg + + downloadAndExtract /opt android-studio-2020.3.1.24-linux.tar.gz android-studio android-studio-2020 https://r6---sn-2gb7sn7s.gvt1.com/edgedl/android/studio/ide-zips/2020.3.1.24/android-studio-2020.3.1.24-linux.tar.gz + setupBase cat <<EOF | sudo tee /opt/android-studio-4.0.1/bin/studio-student.sh > /dev/null #create default user setting for tomcat export ANDROID_SDK_ROOT=$LOCALHD/android-sdk-root -/opt/android-studio-4.0.1/bin/studio.sh +/opt/android-studio-2020/bin/studio.sh EOF - sudo chmod +x /opt/android-studio-4.0.1/bin/studio-student.sh - createLauncher androidStudio "Android Studio" /opt/android-studio-4.0.1/bin/studio-student.sh /opt/android-studio-4.0.1/android-studio.svg "Android Studio IDE" + sudo chmod +x /opt/android-studio-2020/bin/studio-student.sh + createLauncher androidStudio "Android Studio" /opt/android-studio-2020/bin/studio-student.sh /opt/android-studio-2020/studio.svg "Android Studio IDE" sudo mkdir -p $LOCALHD/android-sdk-root sudo chmod go+rwx $LOCALHD/android-sdk-root echo '============>Android Studio installed.===========================================================================================================' @@ -748,7 +780,67 @@ EOF sudo chmod +x /opt/wildfly-20/bin/add-user-student.sh } +function upgrade2021(){ + installJava + uninstallJavaFX + installJavaFX + + installGradle + + removeEclipseInstance java + installEclipseJava + + removeEclipseInstance ee + installEclipseEE + removeEclipseInstance sts +# installEclipseSTS + removeEclipseInstance papyrus + installEclipsePapyrus + + installMaven + uninstallNetBeans + installNetBeans + uninstallIdea + installIdea + + uninstallTomcat + installTomcat + uninstallTomEE +# installTomEE + uninstallWildfly + installWildfly + uninstallAppacheDerby + installAppacheDerby + + uninstallJMeter + installJMeter + uninstallGecko + installGecko + + installVagrant + uninstallAndroidStudio + installAndroidStudio + installDocker + installGitkraken + +} + +function testEclipse(){ + removeEclipseInstance ee + installEclipseEE +} + +function test2(){ + #&& [ $iconUrl = "-" ] + local iconUrl="-"; + if [[ -n "$iconUrl" && "$iconUrl" != "-" ]] ; then + echo download icon + else + echo none + fi + +} if [ $# == 0 ] ; then commands=("installAll") else