简体   繁体   中英

Jython on Mac OS Big Sur (MacOS 11)

Before Mac OS Big Sur was using Jython, installed with homebrew, in JetBrains IntelliJ.

This seems to have broken under Big Sur. Running projects in IntelliJ using Jython was giving me the error

"The operation couldn’t be completed. Unable to locate a Java Runtime that supports -Xmx512m"

So, I uninstalled and reinstalled... now IntelliJ won't recognize Jython at all suggesting it is corrupt.

在此处输入图像描述

I've tried installing from the bottle (which seems to be for catalina)

brew install jython

and building from source

brew install jython --build-from-source  

Any thoughts would be greatly appreciated.

For context, I'm using Jython to do development in ImageJ / Fiji using Python. I realize there's many languages I can develop in in ImageJ (eg Java, Groovy, etc.), but I'm not comfortable enough with those languages to be productive. I am able to work in the Fiji Macro Editor, but IntelliJ allows me to debug (eg stop, step, inspect variables, etc) in ways you can't in the Macro Editor.

Update

Clicking through allows the Jython SDK to be used but you still get

The operation couldn’t be completed. Unable to locate a Java Runtime that supports -Xmx512m.

The investigation is on-going but...

Short answer

The following seems to work.

brew install openjdk
brew install jython
echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.zshrc
echo 'export JAVA_HOME=$(/usr/libexec/java_home)' >> ~/.zshrc

Long answer

This issue is nuanced and the above solution may not work in all circumstances. See this Github issue for a very detailed discussion of the problem.

Most people get this error because they are referencing the python script file in IntelliJ/Burpsuite that requires a direct reference to the.jar file.

If you installed using brew , the actual jar file will be located:

/usr/local/Cellar/jython/2.7.2/libexec/jython.jar

If you'd like to spin up the console, try running this:

java -jar /usr/local/Cellar/jython/2.7.2/libexec/jython.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM