Making AutoAnalyser Python code only start JVM if not already started

This commit is contained in:
Joseph Lizier 2023-08-21 17:55:16 +10:00
parent 817abd1de0
commit 90baf68ee7
1 changed files with 5 additions and 4 deletions

View File

@ -808,10 +808,11 @@ public abstract class AutoAnalyser extends JFrame
} else {
pythonCode.append("import readFloatsFile\n\n");
}
pythonCode.append("# Add JIDT jar library to the path\n");
pythonCode.append("jarLocation = \"" + jarLocation + "\"\n");
pythonCode.append("# Start the JVM (add the \"-Xmx\" option with say 1024M if you get crashes due to not enough memory space)\n");
pythonCode.append("startJVM(getDefaultJVMPath(), \"-ea\", \"-Djava.class.path=\" + jarLocation, convertStrings=True)\n\n");
pythonCode.append("if (not isJVMStarted()):\n");
pythonCode.append(" # Add JIDT jar library to the path\n");
pythonCode.append(" jarLocation = \"" + jarLocation + "\"\n");
pythonCode.append(" # Start the JVM (add the \"-Xmx\" option with say 1024M if you get crashes due to not enough memory space)\n");
pythonCode.append(" startJVM(getDefaultJVMPath(), \"-ea\", \"-Djava.class.path=\" + jarLocation, convertStrings=True)\n\n");
// 3. Matlab:
StringBuffer matlabCode = new StringBuffer();
matlabCode.append("% Add JIDT jar library to the path, and disable warnings that it's already there:\n");