Search

Running NM Collector JE Version 4.0.2 on a Mac

Background


As a java developer, the most difficult platform to deploy on is the Mac. Although Java is designed to run on any platform, Apple has made it difficult to deploy Java applications on Macs. Apple has their own Xcode development environment so that is what they want you to use.


We have been dealing with these changing requirements for years. In this blog post I just want to address the latest release, version 4.0.2, but I will reference previous releases as appropriate. The good news for those who want to run NM Collector Software JE on Macs is that it can be done! The bad news is you cannot just download it from the internet and run it as a Mac application. The good news is that you can take advantage of the underlying Linux kernel and run it as a Linux application! More on that later.


Major Refactoring Required to Deploy NM Collector Software JE as a Mac Application


A recently added Apple requirement for the successful deployment of Mac applications over the internet is to run all applications through a notarization process (https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution) We have begun to work through the new requirement to understand what has to be done to make this work and it seems that certain key components of NM Collector Software JE will have to be completely refactored to meet these new requirements. Since this application is over a decade old and is nearing its end of life, we plan to spend our time developing a completely new and more modern application and do not want to spend time refactoring this old code.


This refactoring is not required for copies of NM Collector Software JE that are not distributed over the internet. If you purchase the USB (https://www.nmcollector.net/product-page/usb-with-nm-collector-software-je-evaluation) you are not affected by this new requirement and can run the software as a Mac application on your Mac.


How to Run NM Collector Software JE as a Linux Application on a Mac


As mentioned earlier, there is another option even for copies of NM Collector Software JE downloaded from the internet. That is to run it as a Linux application on your Mac! Here is how to do it!


1. Pre-requisites:

  1. You must have Java installed on your Mac. Modern Macs no longer come with Java installed. You will have to figure out what Java to download and install. For the current release of NM Collector Software JE, you must install at least Java 8. This limits how old of a Mac you can use for the current release. We do have earlier versions of NM Collector Software JE that will run on earlier versions of Macs. Let us know if you need one of these older versions. I use Oracles OpenJDK (https://openjdk.java.net/install/) on my macOS Big Sur. You can download the latest version for your Mac here: https://jdk.java.net/16/

  2. Mac and Linux use different paths for accessing resources including the underlying database. In order to run NM Collector Software JE as a Linux application on your Mac, you must first copy the Resources directory to a new location so it can be found as a Linux application. You must copy the Resources directory from /NMCollectorJE/NMCollectorJE.app/Contents/ to NMCollectorJE/. Please keep in mind that in order to see the contents of an application on a Mac you must right click the application and choose "Show Package Contents." Here is are some screen captures to illustrate:

Before



During






After


2. Open a Terminal Window in the app subdirectory


a. Right click the app subdirectory and select "New Terminal at Folder"

b. Copy and past the following command into the terminal window and hit return:


java -jar NMCollectorJE.jar



c. As it starts to run you will see messages displayed in the terminal and NM Collector Software JE will open up on your Mac!















17 views0 comments