Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ semantic.cache
html/
help.html
maxent.jar
bin/
tests/
.vscode
.settings

# Windows image file caches
Thumbs.db
Expand Down
8 changes: 4 additions & 4 deletions density/Extractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ else if (!grids[i].getDimension().equals(dimension))
return;
}
features = new Feature[ngrids];
final float[][] vals = new float[numBackground][ngrids];
final double[][] vals = new double[numBackground][ngrids];
int c=0;
for (int i=0; i<numBackground; i++)
vals[c++] = randextract[i].vals;
Expand Down Expand Up @@ -245,7 +245,7 @@ public int compare(Object o1, Object o2) {
int sample=0;
int chosen=0;
long seen=0;
float[] vals = new float[ngrids];
double[] vals = new double[ngrids];
boolean[] hasData = new boolean[ngrids];
for (int r=0; r<nr; r++) {
Utils.reportProgress((r*100)/(double)nr);
Expand All @@ -271,14 +271,14 @@ public int compare(Object o1, Object o2) {
seen++;
if (chosen<n)
randextract[chosen++] =
new Rc(r,c,(float[]) vals.clone());
new Rc(r,c,vals.clone());
else {
long rnd = (seen < Integer.MAX_VALUE) ?
Utils.generator.nextInt((int) seen) :
Utils.generator.nextLong() % seen;
if(rnd < n)
randextract[(int) rnd] =
new Rc(r,c,(float[]) vals.clone());
new Rc(r,c,vals.clone());
}
}
}
Expand Down
13 changes: 0 additions & 13 deletions density/MaxEnt.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,18 @@ a copy of this software and associated documentation files (the

public class MaxEnt {

static void checkVersion() {
String version = System.getProperties().getProperty("java.version");
double v = Double.parseDouble(version.substring(0,3));
// can't call Utils, as Utils needs 1.4 to load (prefs.Preferences)
// if (v < 1.4) Utils.fatalException("Java version is " + version + ", need 1.4 or later", null);
if (v < 1.5) {
JOptionPane.showMessageDialog(null, "Java version is " + version + ", but Maxent needs 1.5 or later.", "Error", JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
}

public static void main(String args[]) {
final Params params = new Params();
params.readFromArgs(args);
Utils.applyStaticParams(params); // also in runner
if (params.getboolean("visible")) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
checkVersion();
createAndShowGUI(params);
}
});
}
else {
checkVersion();
params.setSelections();
Runner runner = new Runner(params);
runner.start();
Expand Down
2 changes: 1 addition & 1 deletion density/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ a copy of this software and associated documentation files (the

public class Utils {

static String version = "3.4.4";
static String version = "3.4.5";
static boolean interrupt=false, warnings=true;
public static boolean verbose=false, visible=true;
static JFrame topLevelFrame = null;
Expand Down
19 changes: 11 additions & 8 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Miro Dudik (mdudik@microsoft.com)
Steven Phillips (mrmaxent@gmail.com)
Rob Schapire (schapire@microsoft.com)

Version 3.4.3, November 2020
Version 3.4.5, April 2026

This file outlines the steps you should take to begin using maxent to
model species geographic distributions. To download the program, or
Expand All @@ -24,7 +24,7 @@ This software is distributed under the MIT License.
Downloading the Software
------------------------
The software consists of a jar file, maxent.jar, which can be used on
any computer running Java version 1.5 or later. Note that if you are
any computer running Java version 1.8 or later. Note that if you are
using a 64-bit computer, you will also need to be using a 64-bit
version of Java.

Expand Down Expand Up @@ -76,11 +76,11 @@ maxent.jar. Alternatively, you might get a response like this:

the java class could not be loaded.
java.lang.UnsupportedClassVersionError: density/maxent (unsupported
major.minor version 49.0)
major.minor version 52.0)

which means that the version of java that is installed on your PC is
out of date. To verify this, open a command window and type "java
-version". You'll probably find that it is older than 1.5, which is
-version". You'll probably find that it is older than 1.8, which is
the oldest version recommended for use with Maxent. To get a new
version, go to java.sun.com, and look for downloads for the Java
runtime environment (JRE).
Expand All @@ -104,19 +104,22 @@ install from java.sun.com as above), or Java is not mentioned in your
variable in the Systems Variable section and click edit. Add the
directory where the java executable is.

For example, if you downloaded Java 1.6.0_13, it was probably
installed in C:\Program Files\Java\jdk1.6.0_13, in
which case you will add ";C:\Program Files\Java\jdk1.6.0_13\bin" to
For example, if you downloaded Java 26, it was probably
installed in C:\Program Files\Java\jdk-26, in
which case you will add ";C:\Program Files\Java\jdk-26\bin" to
the end of the path variable, like in the following example:

C:\Program Files;C:\Winnt;C:\Winnt\System32;C:\Program Files\Java\jdk1.6.0_13\bin
C:\Program Files;C:\Winnt;C:\Winnt\System32;C:\Program Files\Java\jdk-26\bin


2. If the program gives "out-of-memory" or "heap space" errors, it
may be because you are clicking on the maxent.jar file. You need to
click on the maxent.bat file instead. If this is not the problem,
click on the "help" button for more advice.

Main Changes in Version 3.4.5:
-----------------------------
Removed Java version checking due to inconsistencies in version numbering in ARM JDK releases.

Main Changes in Version 3.4.4:
-----------------------------
Expand Down