Skip to content

Commit

Permalink
Compiles under JDK17; readme updated; v4.0.0 now
Browse files Browse the repository at this point in the history
  • Loading branch information
dwvisser committed Dec 22, 2024
1 parent d0c2ab6 commit f0ef9fb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 27 deletions.
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@ Jam - Java-based Data Acquisition for Nuclear Physics
Prerequisites
-------------

Jam requires the Java Development Kit (JDK) version 11 or later. See
[Oracle](https://www.oracle.com/technetwork/java/javase/overview/) or, better yet, install
[OpenJDK](https://openjdk.java.net/). On Ubuntu 18.04 and later, it is possible to simply
execute:
Jam requires the Java Development Kit (JDK) version 17 or later. See
[Oracle](https://www.oracle.com/technetwork/java/javase/overview/) or, better
yet, install [OpenJDK](https://openjdk.java.net/).

> sudo apt install openjdk-11-jdk

In all likelihood, Jam will run on later versions (12 and 13, as of this writing) of Java SE.
This has not been tested in any way, though.

While it is possible to run Jam with just a Java Runtime Environment (JRE), normal usage of Jam
means authoring sort routines in Java, and compiling them against Jam as a library (further
details in the Jam User Guide).
While it is possible to run Jam with just a Java Runtime Environment (JRE),
normal usage of Jam means authoring sort routines in Java, and compiling them
against Jam as a library (further details in the Jam User Guide).

Further User Documentation
--------------------------
Expand All @@ -28,12 +22,13 @@ See the User Guide in the Help menu once the application is launched.
To Launch Jam
-------------

**IMPORTANT**: For the command below to work, make sure that the path to Java 11+ is in your
system path.
**IMPORTANT**: For the command below to work, make sure that the path to `java`
is in your system path.

The easiest way to launch Jam is to download the latest `Jam-X.y.z-jar-with-dependencies.jar`
from the [project releases](https://github.com/dwvisser/jam-daq-code/releases) and launch it as
follows:
The easiest way to launch Jam is to download the latest
`Jam-X.y.z-jar-with-dependencies.jar` from the
[project releases](https://github.com/dwvisser/jam-daq-code/releases) and launch
it as follows:

> java -jar Jam-X.y.z-jar-with-dependencies.jar

Expand All @@ -42,12 +37,14 @@ To Build and Run in Maven

**IMPORTANT**: Make sure you have set the `JAVA_HOME` environment variable.

This assumes you've pulled the Git repository or downloaded the source tarball from GitHub.
This assumes you've pulled the Git repository or downloaded the source tarball
from GitHub.

> mvn package
> mvn exec:java

After making a code change, sometimes it can be useful to execute the clean lifecycle before
After making a code change, sometimes it can be useful to execute the clean
lifecycle before
the package phase:

> mvn clean package
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

<groupId>org.jam-daq</groupId>
<artifactId>Jam</artifactId>
<version>3.1.3</version>
<version>4.0.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.release>17</maven.compiler.release>
</properties>

<build>
Expand Down Expand Up @@ -112,7 +112,7 @@
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.2.3</version>
<version>6.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.help/javahelp -->
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/jam/sort/DiskDaemon.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ private void writeLoop() throws IOException {
}
controller.atWriteEnd();
}
yield();
Thread.yield();
}
// end loop forever
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/jam/sort/SortDaemon.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ private void handleStatusOnline() throws SortException {
if (eventInputStatus == EventInputStatus.END_BUFFER) {
/* We have reached the end of a buffer. */
incrementBufferCount();
yield();
Thread.yield();
} else if (eventInputStatus == EventInputStatus.END_RUN) {
incrementBufferCount();
yield();
Thread.yield();
} else if (eventInputStatus == EventInputStatus.UNKNOWN_WORD) {
LOGGER.warning("Unknown word in event stream.");
} else if (eventInputStatus == EventInputStatus.END_FILE) {
Expand Down Expand Up @@ -263,7 +263,7 @@ private void periodicallyUpdateCounters() {
final int COUNT_UPDATE = 1000;
if (getEventCount() % COUNT_UPDATE == 0) {
updateCounters();
yield();
Thread.yield();
}
}

Expand Down Expand Up @@ -512,7 +512,7 @@ public void sortOnline() throws Exception {// NOPMD
eventInputStatus = eventInputStream.readEvent(eventData);
}
handleStatusOnline();
yield();
Thread.yield();
}// end infinite loop
}

Expand Down

0 comments on commit f0ef9fb

Please sign in to comment.