sanger-pathogens / Artemis

Artemis is a free genome viewer and annotation tool that allows visualization of sequence features and the results of analyses within the context of the sequence, and its six-frame translation
http://sanger-pathogens.github.io/Artemis
Other
236 stars 76 forks source link

Artemis and Java on Mac #345

Open OmniyaF opened 1 year ago

OmniyaF commented 1 year ago

in mac M1 I have installed Open JDK 11.0.9.1 (confirmed with Java - version) and Artemis 11.0.9.1 is not working says "This application requires that Java 9 or later be installed on your computer." The Java path is correct.

any advice?

martinghunt commented 1 year ago

This hack worked for me on an M1 mac to be able to start Artemis and ACT from a terminal.

At the time I did this about a year ago, Open JDK 18 was the latest. Now it's on 20. So if you use 20 then you'll need to edit bits of the following. I keep executables in a ~/bin directory - again you'll need to edit the following if you put things elsewhere.

Get OpenJDK compiled for macOS/AArch64 from here: https://jdk.java.net/18/ . Extract into my ~/bin directory.

Download Artemis, double click on dmg, so is visible in /Volumes. Copy the whole Artemis_Tools/ dir into ~/bin. Then put this in a script called art, fixing any paths for your system (and downloaded version of jdk):

#!/usr/bin/env bash
export PATH=$HOME/bin/jdk-18.0.1.1.jdk/Contents/Home/bin:$PATH
$HOME/bin/Artemis_Tools/Artemis.app/Contents/art “$@“

Open the app once in finder with right click -> open. Otherwise it won’t open in the terminal because is not trusted.

Now running ~/bin/art should just work. Repeat the process similarly for ACT.

bwesen commented 6 months ago

I just tried to download Artemis for the Mac as well and it doesn't work with the same error, "Requires Java 9". Going to java.com and downloading the latest JRE for Mac gives you a "Java 8" I think. I'm not a java guy so I have no idea why the jdks are released at number 18 etc and java with numbers 8 or 9 etc. But I just see that Artemis doesn't work with the latest Java release for Mac which is weird.

https://www.java.com/en/download/ Download Java for macOS Recommended Version 8 Update 401 (filesize: 88.59 MB) Release date: January 16, 2024

martinghunt commented 6 months ago

Just setting this up on a new Mac M3 Pro Sonoma 14.4. The same instructions as above work. This time I used the latest (at the time of writing) OpenJDK JDK 21.0.2 General-Availability Release.

So this time my script ~/bin/art looks like this:

#!/usr/bin/env bash
export PATH=$HOME/bin/jdk-21.0.2.jdk/Contents/Home/bin:$PATH
$HOME/bin/Artemis_Tools/Artemis.app/Contents/art "$@"
AymanMkhalifa commented 2 months ago

@OmniyaF Did you figure this problem out please? I have the same issue and I spent all the day trying to fix it, and still nothing changed. hope you guide me if you still remember