Installing Maxent
Recently, I learned about Maxent from a college student doing a research project, and thought it looked interesting, so I thought I'd give it a whirl.
Documentation is scarce, and mostly favors Windows installations, so I decided to capture the steps I took to get it working on my Mac.
I am running Mac OS Ventura 13.5.2 on a 2019 MacBook Pro, so these downloads and steps may not work for those with other OS versions or hardware configurations.
Use Terminal to Check for Java
Before doing anything, check to see if you have a current version of Java running on your Mac.
If you haven't used Terminal yet, now is the perfect time to start getting familiar with it. From the Dock, click the Launchpad
icon, then enter Terminal
in the search box at the top of the screen to easily find the Terminal application. Click the icon to open the app.
The window that opens allows you to interact directly with your system via the command line.
When the window first opens, you should see something like the following:
Last login: Thu Nov 16 14:21:54 on ttys001
You@Your-Computer-Name ~ %
The cursor is right next to the %
symbol, and this is where you can enter command-line commands to interact with your computer.
Though your prompt always starts with You@Your-Computer-Name ~ %
, for the rest of this article, I will use only the last character, the %
, to indicate the command prompt.
Our first command will be to run Java and ask it to tell us what version it is, to see if it is actually on the system. (For all commands that follow, once you type in the command, you will hit the Enter
key to execute it.)
% java -version
My computer responded with the following:
zsh: command not found: java
Maxent is a Java program, and as such, requires a Java runtime in order to use it. I'm not much of a Java fan, and from the looks of it Apple isn't either, as they no longer include it with a base Mac OS install (they used to), so the first thing we need to do is install the Java JDK.
Install Java JDK
-
Go to https://www.oracle.com/java/technologies/downloads/#jdk21-mac to download the Java JDK.
It is easiest to install via one of the DMG Installer downloads. But first things first, you need to figure out which processor you have on your Mac.
To figure this out, click on the Apple in the upper-left corner and go to
Apple > About This Mac
. The processor listed will determine which installer you need. I have an Intel i9 chip so I downloaded the x64 DMG Installer. If your Mac has an M1 chip, you will need the ARM64 DMG Installer.Once downloaded, double-click on the downloaded
.dmg
file to install the Java JDK. -
Check your Java install
Now re-enter the command from above in Terminal, and you should get a better result:
% java -version
If the above install worked, the computer should now respond with something like the following:
java version "21.0.1" 2023-10-17 LTS Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29) Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)
Excellent. Not only is Java installed and running, but you have also been introduced to the Terminal window. Welcome to life on the command line!
Install Maxent
Once Java is working, you can download Maxent and use the Java JDK to run it.
-
Go to https://biodiversityinformatics.amnh.org/open_source/maxent/ to download Maxent. You can skip entering any information about yourself and just download the file.
-
After the file has downloaded, click on the file in the pop-up menu at the top of your browser, and the file will automatically be unzipped and the resulting
maxent
folder shown inFinder
in theDownloads
folder. Here you can view thereadme.txt
file, as well as the applicationjar
file that will be run using the Java JDK. -
Go back to your Terminal window to run the program.
First you will need to change into the maxent directory, and then run the program. The command line commands to do that are as follows:
% cd ~/Downloads/maxent
The
cd
or change directory command does exactly what the name implies, and changes to the requested directory provided. What followscd
is thepath
you want cd to use when changing directories. The~/Downloads/maxent
parameter shown tells thecd
command to navigate to your home directory (the ~ is a shortcut for your home directory), then into the Downloads folder, and then into the maxent folder (the one you just downloaded).After you hit enter, the command prompt will come back looking slightly different:
You@Your-Computer-Name maxent %
Note that the directory
maxent
is now displayed just before the prompt. This lets you know what directory you are in.Now that we're in the right place, let's run maxent:
% java -mx512m -jar maxent.jar
This command is taken from the readme.txt file provided with Maxent, and it is what uses Java to run the Maxent program (the
jar
file you just downloaded).
You should see the Maxent launch screen, and should be able to follow the provided Tutorials from here!