Skip to content

Commit

Permalink
MORTAR v1.2.0.0
Browse files Browse the repository at this point in the history
Merge pull request #119 from FelixBaensch/production
  • Loading branch information
JonasSchaub committed May 24, 2024
2 parents 9793153 + 9989952 commit be20359
Show file tree
Hide file tree
Showing 98 changed files with 8,359 additions and 5,598 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cff-version: 1.2.0
title: MORTAR
version: 1.1.1.0
version: "1.2.0.0"
message: "If you use this software, please cite it as below."
type: software
authors:
Expand All @@ -26,7 +26,7 @@ authors:
given-names: "Achim"
orcid: "https://orcid.org/0000-0003-0722-4229"
doi: "10.5281/zenodo.6984804"
date-released: 2023-06-27
date-released: 2024-05-24
url: "https://github.com/FelixBaensch/MORTAR"
license: MIT
references:
Expand Down
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ Pre-compiled and executable MORTAR distributions can be found attached to the

<p>
<b>Windows:</b> A convenient Windows OS installer executable for MORTAR is available
(click <a href="https://github.com/FelixBaensch/MORTAR/releases/download/v1.1.1.0/MORTAR_v1.1.1.0_WINx64_installer.exe">here</a> to
(click <a href="https://github.com/FelixBaensch/MORTAR/releases/download/v1.2.0.0/MORTAR_v1.2.0.0_WINx64_installer.exe">here</a> to
automatically download the installer .exe of the latest version). Download the installer
executable, start, and follow the instructions to install MORTAR. Note that the installation includes a full
Java Runtime Environment (JRE). After installation, create a shortcut to an appropriate MORTAR start batch file on your
Windows desktop. E.g. for MORTAR to use up to 4 gigabyte of RAM, copy a shortcut to batch file "MORTAR.bat" which is
located in the MORTAR program folder (default "C:\Program Files\MORTAR\MORTARv1.1.1.0\bin" or the path specified at
located in the MORTAR program folder (default "C:\Program Files\MORTAR\MORTARv1.2.0.0\bin" or the path specified at
installation). To start MORTAR, double-click the created shortcut. MORTAR can be uninstalled by the provided
Uninstall.exe executable in the MORTAR program folder or standard Windows functions.
<br>
Expand All @@ -79,29 +79,35 @@ As an alternative to "MORTAR.bat", there is also the "MORTAR_20GB.bat" batch fil
and adjust the line
</p>

<p><code>set DEFAULT_JVM_OPTS="-Xms4g" "-Xmx4g"</code></p>
```shell
set DEFAULT_JVM_OPTS="-Xms4g" "-Xmx4g"
```

with your chosen initially allocated memory (-Xms) and maximum value (-Xmx) accordingly.<br>

<p>Should this installation or the execution of the batch files not work for you, try the guidelines for Linux and MaxOS
described below. As an alternative way, they should also work on Windows.
</p>

<p><b>Linux and macOS:</b> Every release has the executable Java ARchive (JAR) "MORTAR-fat-1.1.1.0.jar"
<p><b>Linux and macOS:</b> Every release has the executable Java ARchive (JAR) "MORTAR-fat-1.2.0.0.jar"
attached, which contains the packaged MORTAR code together with all dependencies
(click <a href="https://github.com/FelixBaensch/MORTAR/releases/download/v1.1.1.0/MORTAR-fat-1.1.1.0.jar">here</a> to
automatically download the JAR of the latest version).
(click <a href="https://github.com/FelixBaensch/MORTAR/releases/download/v1.2.0.0/MORTAR-fat-1.2.0.0.jar">here</a>
to automatically download the JAR of the latest version).
To run MORTAR (with up to 4 GB of RAM available, e.g.),
execute the JAR from the command-line using</p>

<p><code>java -jar -Xms512m -Xmx4g [path to]MORTAR-fat-1.1.1.0.jar</code></p>
```shell
java -jar -Xms512m -Xmx4g <path to>MORTAR-fat-1.2.0.0.jar
```

A JDK or JRE of version 17.0.4 or higher (v21.0.1 for the upcoming release) needs to be installed on your system and linked to the "java" command.
A JDK or JRE of version 21.0.1 or higher needs to be installed on your system and linked to the "java" command.
Otherwise, replace "java" with the path to the java command of your JDK or JRE.<br>
Execute the command in the directory where the JAR is situated or use its explicit path instead of ```<path to>```.<br>
Adjust the initially allocated memory (-Xms) and maximum memory to be used (-Xmx) according to your preferences.

<p>Please note that MORTAR only supports x64 (on all three platforms) and AArch64 (on macOS and Linux) architectures in general.
For the latter, a special "fat JAR" named "MORTAR-fat-aarch64-1.1.1.0.jar" is available from the distributions attached to the releases and must be used
(click <a href="https://github.com/FelixBaensch/MORTAR/releases/download/v1.1.1.0/MORTAR-fat-aarch64-1.1.1.0.jar">here</a> to
For the latter, a special "fat JAR" named "MORTAR-fat-aarch64-1.2.0.0.jar" is available from the distributions attached to the releases and must be used
(click <a href="https://github.com/FelixBaensch/MORTAR/releases/download/v1.2.0.0/MORTAR-fat-aarch64-1.2.0.0.jar">here</a> to
automatically download the AArch64 JAR of the latest version).</p>
Also note that using the Windows Subsystem for Linux (WSL) is not recommended, since a lot of additional configurations
have to be made there to run Java GUI applications.
Expand Down Expand Up @@ -135,7 +141,7 @@ into it (i.e. sub-folders of "AdoptOpenJDK\jdk-21.0.1_12_jre\" need to be "bin",
* LibrePDF OpenPDF version 1.3.26
* [OpenPDF GitHub repository](https://github.com/LibrePDF/OpenPDF)
* License: GNU Lesser General Public License 2.1
* Spotless version 6.23
* Spotless version 6.25
* [Spotless GitHub repository](https://github.com/diffplug/spotless)
* License: Apache-2.0 license

Expand Down
Binary file modified Tutorial/MORTAR_Tutorial.pdf
Binary file not shown.
53 changes: 40 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import java.util.regex.Matcher

plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.14'
id 'com.diffplug.spotless' version '6.23.3'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'com.diffplug.spotless' version '6.25.0'
}

group 'de.unijena.cheminf'
version '1.1.1.0'
version '1.2.0.0'

sourceCompatibility = 1.21

Expand Down Expand Up @@ -55,6 +55,10 @@ dependencies {
implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac-aarch64'
}

javafx {
modules = ['javafx.base','javafx.graphics', 'javafx.controls', 'javafx.swing']
}

test {
useJUnitPlatform()
testLogging {
Expand All @@ -67,21 +71,32 @@ applicationName = 'MORTAR'

applicationDefaultJvmArgs = ["-Xms4g", "-Xmx4g"]


/*
* Merges the exact enumeration of all library jars into one single path giving all the files and subfolders in 'lib'.
* This is necessary because lines that are too long cause errors in batch files.
* The unix script still has to be tested!
*/
startScripts {
doLast {
windowsScript.text = windowsScript.text.replaceAll('set CLASSPATH=.*', 'set CLASSPATH=.;%APP_HOME%/lib/*')
//suppress console window by using javaw instead of java
windowsScript.text = windowsScript.text.replaceAll("java.exe", "javaw.exe")
//use JRE shipped with MORTAR instead of Java installed on the machine and rename method to set the java home to use
windowsScript.text = windowsScript.text.replace("if defined JAVA_HOME goto findJavaFromJavaHome", "goto setJavaFromAppHome\n\n@rem unused because Java home is set in method called above")
windowsScript.text = windowsScript.text.replace(":findJavaFromJavaHome", ":setJavaFromAppHome")
windowsScript.text = windowsScript.text.replace("set JAVA_HOME=%JAVA_HOME:\"=%",
"set JAVA_HOME=%APP_HOME%\\jdk-21.0.1_12_jre\\")
windowsScript.text = windowsScript.text.replaceAll("java.exe", "javaw.exe")
//windowsScript.text = windowsScript.text.replace("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%", "start \"MORTAR\" \"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%") //dirty workaround to suppress command window
//dirty workaround to suppress command window and pass CMD options to MORTAR to suppress the Java version check
//Merges the exact enumeration of all library jars into one single path giving all the files and subfolders in 'lib'
// This is necessary because lines that are too long cause errors in batch files.
windowsScript.text = windowsScript.text.replaceAll('set CLASSPATH=.*', 'set CLASSPATH=.;%APP_HOME%/lib/*')
//workaround to suppress command window by starting named process "MORTAR" - legacy
//windowsScript.text = windowsScript.text.replace("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%", "start \"MORTAR\" \"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%")
//workaround to suppress command window and pass CMD options to MORTAR to suppress the Java version check
windowsScript.text = windowsScript.text.replace("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %MORTAR_OPTS% -classpath \"%CLASSPATH%\" de.unijena.cheminf.mortar.main.Main %*",
"start \"MORTAR\" \"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %MORTAR_OPTS% -classpath \"%CLASSPATH%\" de.unijena.cheminf.mortar.main.Main \"-skipJavaVersionCheck\"")
//adjusting error messages
windowsScript.text = windowsScript.text.replace("Please set the JAVA_HOME variable in your environment to match the", "Please check your MORTAR installation,")
windowsScript.text = windowsScript.text.replace("location of your Java installation.", "something must be wrong with the Java Runtime Environment shipped with MORTAR.")

//Merges the exact enumeration of all library jars into one single path giving all the files and subfolders in 'lib' for unix script
unixScript.text = unixScript.text.replaceAll('CLASSPATH=\\Q$\\EAPP_HOME/lib.*', Matcher.quoteReplacement('CLASSPATH=$APP_HOME/lib/*'))
}
}
Expand All @@ -95,14 +110,26 @@ task updateHeapSpace20GbExtraRunApp(type: CreateStartScripts) {

updateHeapSpace20GbExtraRunApp {
doLast {
windowsScript.text = windowsScript.text.replaceAll('set CLASSPATH=.*', 'set CLASSPATH=.;%APP_HOME%/lib/*')
//suppress console window by using javaw instead of java
windowsScript.text = windowsScript.text.replaceAll("java.exe", "javaw.exe")
//use JRE shipped with MORTAR instead of Java installed on the machine and rename method to set the java home to use
windowsScript.text = windowsScript.text.replace("if defined JAVA_HOME goto findJavaFromJavaHome", "goto setJavaFromAppHome\n\n@rem unused because Java home is set in method called above")
windowsScript.text = windowsScript.text.replace(":findJavaFromJavaHome", ":setJavaFromAppHome")
windowsScript.text = windowsScript.text.replace("set JAVA_HOME=%JAVA_HOME:\"=%",
"set JAVA_HOME=%APP_HOME%\\jdk-21.0.1_12_jre\\")
windowsScript.text = windowsScript.text.replaceAll("java.exe", "javaw.exe")
//windowsScript.text = windowsScript.text.replace("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%", "start \"MORTAR\" \"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%") //dirty workaround to suppress command window
//dirty workaround to suppress command window and pass CMD options to MORTAR to suppress the Java version check
//Merges the exact enumeration of all library jars into one single path giving all the files and subfolders in 'lib'
// This is necessary because lines that are too long cause errors in batch files.
windowsScript.text = windowsScript.text.replaceAll('set CLASSPATH=.*', 'set CLASSPATH=.;%APP_HOME%/lib/*')
//workaround to suppress command window by starting named process "MORTAR" - legacy
//windowsScript.text = windowsScript.text.replace("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%", "start \"MORTAR\" \"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%")
//workaround to suppress command window and pass CMD options to MORTAR to suppress the Java version check
windowsScript.text = windowsScript.text.replace("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %MORTAR_20_GB_OPTS% -classpath \"%CLASSPATH%\" de.unijena.cheminf.mortar.main.Main %*",
"start \"MORTAR\" \"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %MORTAR_20_GB_OPTS% -classpath \"%CLASSPATH%\" de.unijena.cheminf.mortar.main.Main \"-skipJavaVersionCheck\"")
//adjusting error messages
windowsScript.text = windowsScript.text.replace("Please set the JAVA_HOME variable in your environment to match the", "Please check your MORTAR installation,")
windowsScript.text = windowsScript.text.replace("location of your Java installation.", "something must be wrong with the Java Runtime Environment shipped with MORTAR.")

//Merges the exact enumeration of all library jars into one single path giving all the files and subfolders in 'lib' for unix script
unixScript.text = unixScript.text.replaceAll('CLASSPATH=\\Q$\\EAPP_HOME/lib.*', Matcher.quoteReplacement('CLASSPATH=$APP_HOME/lib/*'))
}
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit be20359

Please sign in to comment.