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

JES doesn't have proper access to the file system on MacOS Catalina #133

Open
NicMcPhee opened this issue Aug 11, 2020 · 6 comments
Open

Comments

@NicMcPhee
Copy link

I've just installed JES 6.0 on a MacOS Catalina box. After installing JDK 8 and disabling OpenJDK 14 😒 💔 😒 , JES starts up OK and appears to work.

It fails, however, to display any files in directories such as "Downloads" or "Documents" – I just get a blank file box like there's nothing there (& there are dozens of files and folders there):

Screen Shot 2020-08-11 at 2 05 23 PM

Some folders (like "Dropbox") work, so I think this is a problem where MacOS is "protecting" certain "special" folders like "Downloads" and "Documents". With other applications, MacOS asks "Do you want to give this program permission to access ?", but no such question comes up with JES, perhaps because some error or exception is being swallowed or otherwise ignored?

Looking in the Console there are errors like:

Sandbox: java(87457) System Policy: deny(1) file-read-data /Users/mcphee/Downloads

which support the idea that the OS is blocking these accesses.

Weirdly, if I start it from the command line (./jes.sh) the problem doesn't exist and it can find things in "Downloads" and "Documents". This makes me wonder if the suggestion to "simply disable" new versions of Java actually doesn't completely work. That's a pretty icky workaround for beginning students, especially in a course that's supposed to be friendly for non-computer-nerds. 😢 (& looking at the console, it appears that the same version of Java from the same place is being started whether I double-click the snake or run it from the command line. Not at all clear what the difference might be.)

I tried giving the Java 8 java full disk access, but that didn't fix/change anything, which seems odd.

This sounds like it's perhaps related to #128.

@mjguzdial
Copy link
Contributor

mjguzdial commented Aug 11, 2020 via email

@NicMcPhee
Copy link
Author

This Apple Developer Forum thread suggests that it's something about the way you bundle the app. You're definitely using JFileChooser like that poster is, so the situation sounds pretty similar.

It looks like you use a script as your main executable, which this thread says "is not a good idea in general, and … can cause exactly this problem", so that seems a likely culprit.

That might also explain why running JES from the CLI doesn't have this access problem, although I'm not really sure why that would be. Maybe if I run it from the CLI it runs as a different user and ends up with different privileges?

@mjguzdial
Copy link
Contributor

mjguzdial commented Aug 12, 2020 via email

@NicMcPhee
Copy link
Author

I've never gotten into modern MacOS app bundling, so I've just stepped off the edge of the map.

There must be people doing this, though, as there are definitely plenty of other apps written in Java. Isn't, for example, Minecraft a Java project?

@Rasspyy
Copy link

Rasspyy commented Aug 18, 2020

Has there been a solution to this? I have to download JES 5.02 on my macOS Catalina for my CS Class but it isn't letting me. Please help

@mjguzdial
Copy link
Contributor

mjguzdial commented Aug 18, 2020 via email

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