From f31b0c72c1799a07db5a9fb9db06e5f4e9d3f9ec Mon Sep 17 00:00:00 2001
From: Greg DiCristofaro <gregd@basistech.com>
Date: Tue, 27 Jun 2023 15:42:56 -0400
Subject: [PATCH] updates for linux and mac

---
 .travis.yml                                   | 61 ++++++++++++-------
 BUILDING.txt                                  |  4 +-
 README.txt                                    |  4 +-
 Running_Linux_OSX.md                          |  8 +--
 appveyor.yml                                  |  5 +-
 .../install_prereqs_macos.sh                  | 13 +---
 .../install_prereqs_ubuntu.sh                 | 20 ++----
 7 files changed, 55 insertions(+), 60 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 28218be2c9..569c9b9312 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,27 +15,50 @@ addons:
   apt:
     update: true
     packages:
+      - openjdk-17-jdk
+      - openjdk-17-jre
+      - build-essential
+      - autoconf
+      - libtool
+      - automake
+      - git
+      - zip
+      - wget
+      - ant
+      - libde265-dev
+      - libheif-dev
+      - libpq-dev
       - testdisk
       - libafflib-dev
       - libewf-dev
-      - libpq-dev
-      - autopoint
-      - libsqlite3-dev
-      - ant
-      - ant-optional
-      - libcppunit-dev
-      - wget
+      - libvhdi-dev
+      - libvmdk-dev
+      - libgstreamer1.0-0
+      - gstreamer1.0-plugins-base
+      - gstreamer1.0-plugins-good
+      - gstreamer1.0-plugins-bad
+      - gstreamer1.0-plugins-ugly
+      - gstreamer1.0-libav
+      - gstreamer1.0-tools
+      - gstreamer1.0-x
+      - gstreamer1.0-alsa
+      - gstreamer1.0-gl
+      - gstreamer1.0-gtk3
+      - gstreamer1.0-qt5
+      - gstreamer1.0-pulseaudio
   homebrew:
     update: true
     packages:
-      - ant
-      - wget
-      - libpq
-      - libewf
-      - gettext
-      - cppunit
+      - openjdk@17
+      - ant 
+      - automake
+      - libtool
       - afflib
+      - libewf
+      - postgresql@15
       - testdisk
+      - libheif 
+      - gstreamer 
 
 python:
   - 2.7
@@ -49,19 +72,11 @@ install:
 
 before_script:
   - if [ $TRAVIS_OS_NAME = linux ]; then 
-        wget -q -O - https://download.bell-sw.com/pki/GPG-KEY-bellsoft | sudo apt-key add -;
-        echo "deb [arch=amd64] https://apt.bell-sw.com/ stable main" | sudo tee /etc/apt/sources.list.d/bellsoft.list; 
-        sudo apt-get update;
-        sudo apt-get install bellsoft-java17-full;
         export PATH=/usr/bin:$PATH;
-        export JAVA_HOME=/usr/lib/jvm/bellsoft-java17-full-amd64; 
+        export JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64; 
     fi
   - if [ $TRAVIS_OS_NAME = osx ]; then 
-        brew uninstall java --force --ignore-dependencies; 
-        brew cask uninstall java --force; 
-        brew tap bell-sw/liberica; 
-        brew install --cask liberica-jdk17-full; 
-        export JAVA_HOME=/Library/Java/JavaVirtualMachines/liberica-jdk-17-full.jdk/Contents/Home;
+        export JAVA_HOME=$(/usr/libexec/java_home -v 17);
     fi
   - java -version
 
diff --git a/BUILDING.txt b/BUILDING.txt
index 8da32f6a76..ae1ab15d04 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -11,9 +11,9 @@ correct C libraries.
 STEPS:
 1) Get Java Setup
 
-1a) Download and install 64-bit JDK version 17 with JavaFX.
+1a) Download and install 64-bit JDK version 17.
 
-Autopsy has been used and tested with liberica java which can be downloaded from here: https://bell-sw.com/pages/downloads/.
+Autopsy has been used and tested with java 17 which can be downloaded from here: https://www.oracle.com/java/technologies/downloads/#java17.
 
 
 1b) Ensure that JDK_HOME is set to the root JDK directory.
diff --git a/README.txt b/README.txt
index 063d6bc7a7..9aabcd6fc3 100644
--- a/README.txt
+++ b/README.txt
@@ -43,8 +43,8 @@ This section lists the software components and libraries that are used by
 Autopsy.   These tools are bundled with the Windows installer, unless specified otherwise.
 
 JRE (Java Runtime Environment) 17
-- Web page: https://bell-sw.com/pages/downloads/
-- License: https://bell-sw.com/liberica_eula/
+- Web page: https://www.oracle.com/java/technologies/downloads/#java17
+- License: https://www.oracle.com/a/tech/docs/jdk17-lium.pdf
 
 Netbeans 15 RCP platform and .jar files bundled with the platform
 - Web page: https://netbeans.apache.org/
diff --git a/Running_Linux_OSX.md b/Running_Linux_OSX.md
index d6946d6c6e..fbc4828c29 100644
--- a/Running_Linux_OSX.md
+++ b/Running_Linux_OSX.md
@@ -13,7 +13,7 @@ When installing on Debian-based Linux or macOS systems, there are three general
 
 # Installing Autopsy
 - Download the Autopsy zip file from [repository releases](https://github.com/sleuthkit/autopsy/releases).  The file will be marked as "autopsy-&lt;release&gt;.zip" (i.e. "autopsy-4.19.2.zip").
-- Run [`install_application.sh`](./linux_macos_install_scripts/install_application.sh) with the following parameters: `install_application.sh [-z zip_path] [-i install_directory] [-j java_home]`.  An example would be `install_application.sh -z ~/Downloads/autopsy-4.19.2.zip -i ~/autopsy -j /usr/lib/jvm/bellsoft-java17-full-amd64`.  The path to the Java 17 home is the last output from the [prequisites installation scripts](#installing-prerequisites), but typically, the path will be `/usr/lib/jvm/bellsoft-java17-full-amd64` on Debian-based Linux or the output of running `/usr/libexec/java_home -v 17` on macOS.
+- Run [`install_application.sh`](./linux_macos_install_scripts/install_application.sh) with the following parameters: `install_application.sh [-z zip_path] [-i install_directory] [-j java_home]`.  An example would be `install_application.sh -z ~/Downloads/autopsy-4.19.2.zip -i ~/autopsy -j /usr/lib/jvm/java-1.17.0-openjdk-amd64`.  The path to the Java 17 home is the last output from the [prequisites installation scripts](#installing-prerequisites), but typically, the path will be in the result of running  `update-java-alternatives -l | grep java-1.17` on Debian-based Linux or the output of running `/usr/libexec/java_home -v 17` on macOS.
 
 # Setup macOS JNA paths
 If you are on macOS, run [linux_macos_install_scripts/add_macos_jna.sh](./linux_macos_install_scripts/add_macos_jna.sh) to properly setup the jna path to get things like gstreamer working.  An example would be `add_macos_jna.sh -i ~/autopsy`.
@@ -26,9 +26,9 @@ If you are on macOS, run [linux_macos_install_scripts/add_macos_jna.sh](./linux_
   the wrong version of Java is being used to run Autopsy.
   Check the version of Java reported in the `messages.log` file in the log directory.  The log directory can be found by opening Autopsy, and, with no cases open, go to 'Help' > 'Open Log Folder'. `messages.log` should contain lines that looks like:
   ```
-  Java; VM; Vendor        = 17.0.7; OpenJDK 64-Bit Server VM 17.0.7+7-LTS; BellSoft
-  Runtime                 = OpenJDK Runtime Environment 17.0.7+7-LTS
-  Java Home               = /usr/lib/jvm/bellsoft-java17-full-amd64
+  Java; VM; Vendor        = 17.0.7; OpenJDK 64-Bit Server VM 17.0.7+7-Ubuntu-0ubuntu122.04.2; Private Build
+  Runtime                 = OpenJDK Runtime Environment 17.0.7+7-Ubuntu-0ubuntu122.04.2
+  Java Home               = /usr/lib/jvm/java-17-openjdk-amd64
   ```
 
   If your `messages.log` file indicates that Java 17 is not being used:
diff --git a/appveyor.yml b/appveyor.yml
index d691bcd385..58c97ed5c2 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -11,14 +11,13 @@ platform: x64
 environment:
   global:
     TSK_HOME: "C:\\sleuthkit"
-    JDK_HOME: C:\Program Files\BellSoft\LibericaJDK-17-Full
-    JAVA_HOME: C:\Program Files\BellSoft\LibericaJDK-17-Full
+    JDK_HOME: C:\Program Files\Java\jdk17
+    JAVA_HOME: C:\Program Files\Java\jdk17
     PYTHON: "C:\\Python36-x64"
 
 install:
   - ps: choco install nuget.commandline
   - ps: choco install ant --ignore-dependencies
-  - ps: choco install liberica17jdkfull --force
   - git clone https://github.com/sleuthkit/sleuthkit
   - ps: $env:Path="$($env:JAVA_HOME)\bin;$($env:Path);C:\ProgramData\chocolatey\lib\ant"
   - set PATH=C:\Python36-x64\';%PATH%
diff --git a/linux_macos_install_scripts/install_prereqs_macos.sh b/linux_macos_install_scripts/install_prereqs_macos.sh
index 8a35cd819f..de9b3b22a3 100644
--- a/linux_macos_install_scripts/install_prereqs_macos.sh
+++ b/linux_macos_install_scripts/install_prereqs_macos.sh
@@ -1,15 +1,6 @@
 #!/bin/bash
-echo "Installing liberica java 17..."
-brew tap bell-sw/liberica && \
-brew install --cask liberica-jdk17-full
-if [[ $? -ne 0 ]] 
-then 
-    echo "Unable to install liberica java" >> /dev/stderr
-    exit 1
-fi
-
-echo "Installing remaining dependencies..."
-brew install ant automake libtool afflib libewf postgresql@15 testdisk libheif gstreamer
+echo "Installing dependencies..."
+brew install openjdk@17 ant automake libtool afflib libewf postgresql@15 testdisk libheif gstreamer 
     
 if [[ $? -ne 0 ]] 
 then 
diff --git a/linux_macos_install_scripts/install_prereqs_ubuntu.sh b/linux_macos_install_scripts/install_prereqs_ubuntu.sh
index 498dd546a1..f5897e23d1 100644
--- a/linux_macos_install_scripts/install_prereqs_ubuntu.sh
+++ b/linux_macos_install_scripts/install_prereqs_ubuntu.sh
@@ -11,7 +11,9 @@ fi
 
 echo "Installing all apt dependencies..."
 sudo apt update && \
-    sudo apt -y install build-essential autoconf libtool automake git zip wget ant \
+    sudo apt -y install \
+        openjdk-17-jdk openjdk-17-jre \
+        build-essential autoconf libtool automake git zip wget ant \
         libde265-dev libheif-dev \
         libpq-dev \
         testdisk libafflib-dev libewf-dev libvhdi-dev libvmdk-dev \
@@ -24,18 +26,6 @@ if [[ $? -ne 0 ]]; then
     exit 1
 fi
 
-echo "Installing bellsoft Java 17..."
-pushd /usr/src/ &&
-    wget -q -O - https://download.bell-sw.com/pki/GPG-KEY-bellsoft | sudo apt-key add - &&
-    echo "deb [arch=amd64] https://apt.bell-sw.com/ stable main" | sudo tee /etc/apt/sources.list.d/bellsoft.list &&
-    sudo apt update &&
-    sudo apt -y install bellsoft-java17-full &&
-    popd
-if [[ $? -ne 0 ]]; then
-    echo "Failed to install bellsoft java 17" >>/dev/stderr
-    exit 1
-fi
-
 echo "Autopsy prerequisites installed."
-echo "Java path at /usr/lib/jvm/bellsoft-java17-full-amd64: "
-ls /usr/lib/jvm/bellsoft-java17-full-amd64
\ No newline at end of file
+echo "Java 17 instllation: "
+update-java-alternatives -l | grep java-1.17
-- 
GitLab