JGAAP icon indicating copy to clipboard operation
JGAAP copied to clipboard

Mac OS Big Sur problem

Open ebeshero opened this issue 5 years ago • 12 comments

I'm fighting with my Mac to get it to allow JGAAP to open files in my Documents directory. Unfortunately, the guidelines in the https://github.com/evllabs/JGAAP/blob/master/docs/OSX_User_Guide.pdf aren't quite enough. The app opens, but I need to get Big Sur to recognize a .jar file as the kind of app to which it can give permission to access my directories.

ebeshero avatar Apr 23 '21 01:04 ebeshero

I am not sure I understand the issue you are facing. Although I do not regularly use macOS, I did just test JGAAP on macOS Big Sur, and it worked alright for me. Here are the steps I followed:

  1. Double-click on JGAAP jar file.
  2. Click "OK" on the following prompt: image
  3. JGAAP UI launched, and I was able to define the text file I wanted to run experiments on.

Can you describe how your process differs from the one I show here?

DavidBerdik avatar Apr 23 '21 01:04 DavidBerdik

@DavidBerdik I don't see that prompt (to allow java to access Desktop files) when I click on the JGAAP.jar (which I set on my Desktop). However, I am pretty sure that as you indicate it's a Java issue. I resolved my issue in the Terminal (which may not be ideal for most users). I checked my Java HOME and it's probably in a nonstandard place (in a .jenv folder, which seemed weird). I basically just navigated to my Desktop in the Terminal and ran:

java -jar JGAAP-8.0.1.jar

And this time when it started up, I was able to add authors and documents as expected. The problem I was seeing was: On trying to add an Author and select documents, I could navigate as far as my Documents, and then could see nothing in JGAAP's representation of my directories. Running from my terminal seems to take care of the problem, at least for me.

ebeshero avatar Apr 23 '21 02:04 ebeshero

If you go to System Preferences → Security and Privacy → Click the lock to make changes → Files and Folders, do you see an option for Java?

image

DavidBerdik avatar Apr 23 '21 02:04 DavidBerdik

@DavidBerdik No, it's not among the apps listed in System Preferences, though I do find it via Terminal.

ebeshero avatar Apr 23 '21 04:04 ebeshero

Hmm alright. Do you recall how you installed Java on your system? Also, do you know what version it is (java -version in the terminal will tell you)?

I know you managed to work around the issue, but I'm trying to gather information that might be useful in sorting out this problem properly both for you and for others who may encounter it.

DavidBerdik avatar Apr 23 '21 04:04 DavidBerdik

@DavidBerdik Yes, I checked that a while back. It's Java 15, and I installed it last fall I think, though I don't quite remember how. It's installed, as I mentioned in an odd location, in my Users profile, in a .venv directory, but it does resolve when I echo $JAVA_HOME.

ebeshero avatar Apr 23 '21 04:04 ebeshero

@DavidBerdik This is what I have: java version "15" 2020-09-15 Java(TM) SE Runtime Environment (build 15+36-1562) Java HotSpot(TM) 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)

ebeshero avatar Apr 23 '21 04:04 ebeshero

Also, I'm trying to find out if any of my students on Macs saw this problem. I asked them to try installing something earlier in the semester (before JGAAP, it was the eXist XML database) that required installing Java if they didn't have it, and I directed them to Oracle here: https://www.java.com/en/download/help/index_installing.html

I was debating whether to send them to Open JDK...but Oracle seemed a little safer somehow. Anyway, for lots of them it was their first experience having to install Java. Most of my students are on Windows, but a few of us (including me) are on Macs--I'll see if they'll tell me more tomorrow! @juola delivered a workshop on Wednesday and I wound up just watching his screen instead of running JGAAP on my computer at the time because of this weird Java problem--I'm glad I solved it for myself, but I wonder if it affected anyone else in my student crew.

ebeshero avatar Apr 23 '21 04:04 ebeshero

Yeah there are too many variables here unfortunately. I can tell you about my setup though in case it helps. I use the OpenJDK distribution offered through Homebrew.

If you are familiar with various open source Linux distros, then you probably know about package managers such as apt and yum. Unfortunately, macOS does not include a package manager of this sort out of the box. That's where Homebrew comes in. After installing it, it's very easy to install various tools on your system through the command line.

To set up OpenJDK through Homebrew:

  1. Install Homebrew. Instructions are here: https://brew.sh/
  2. After it is installed, run brew install openjdk in the terminal (https://formulae.brew.sh/formula/openjdk)
  3. After the install finishes, Java is ready for use!

My Java info as of this posting:

Davids-Mac:~ david$ java -version
openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment (build 15.0.2+7)
OpenJDK 64-Bit Server VM (build 15.0.2+7, mixed mode, sharing)

DavidBerdik avatar Apr 23 '21 05:04 DavidBerdik

I know you managed to work around the issue, but I'm trying to gather information that might be useful in sorting out this problem properly both for you and for others who may encounter it.

@DavidBerdik here is some good discussion on why launching from the terminal is a viable workaround in Big Sur: https://stackoverflow.com/questions/65469536/why-does-a-jar-file-have-no-permissions-to-read-from-disk-when-started-via-doubl

bakerj avatar Apr 23 '21 06:04 bakerj

OP here. As I’m now running a later M1 Mac than when I first posted, I am guessing that the location of the JAR Launcher will vary by OS and whether it has the M1/M2 Silicon vs Intel chip. Might be messy to generalize the location for all Mac systems.

Typeset by hand on my iPhone On Aug 2, 2023, at 1:42 PM, Eggbertx @.***> wrote: When you double click on a JAR file, by default macOS runs it with an app called JAR Launcher, located at /System/Library/CoreServices/Jar Launcher. This needs to be manually added to the file access to let JGAAP (and other JAR programs) access files through the open/save file dialog

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

ebeshero avatar Aug 03 '23 12:08 ebeshero

Unfortunately, I no longer have access to the virtual machine that I used to use for testing stuff on macOS, so I can't really provide much input into this, but assuming that this forum post is correct, it sounds like Apple no longer provides a built-in jar launcher with macOS?

DavidBerdik avatar Aug 03 '23 18:08 DavidBerdik