Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS Big Sur problem #117

Open
ebeshero opened this issue Apr 23, 2021 · 12 comments
Open

Mac OS Big Sur problem #117

ebeshero opened this issue Apr 23, 2021 · 12 comments

Comments

@ebeshero
Copy link
Contributor

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.

@DavidBerdik
Copy link
Member

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?

@ebeshero
Copy link
Contributor Author

@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.

@DavidBerdik
Copy link
Member

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

@ebeshero
Copy link
Contributor Author

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

@DavidBerdik
Copy link
Member

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.

@ebeshero
Copy link
Contributor Author

ebeshero commented Apr 23, 2021

@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
Copy link
Contributor Author

@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
Copy link
Contributor Author

ebeshero commented Apr 23, 2021

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.

@DavidBerdik
Copy link
Member

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)

@bakerj
Copy link

bakerj commented Apr 23, 2021

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

@ebeshero
Copy link
Contributor Author

ebeshero commented Aug 3, 2023 via email

@DavidBerdik
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants