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

view.image.2d doesn't work if no proper X11 is available #114

Open
rickhelmus opened this issue Dec 14, 2020 · 0 comments
Open

view.image.2d doesn't work if no proper X11 is available #114

rickhelmus opened this issue Dec 14, 2020 · 0 comments

Comments

@rickhelmus
Copy link
Contributor

Hello,

The view.image.2d() function currently results in error if the DISPLAY variable is set while X11 is not actually available, eg

Error in .jcall(mi, "[B", "getBytes", as.integer(depictor$getWidth()),  : 
  java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE

Such an (unfortunate) situation is actually happening with RStudio Docker images. Unsetting DISPLAY prior to starting R is a workaround, as Java awt automatically starts in headless mode. Setting headless manually also works:

rJava::J("java.lang.System")$setProperty("java.awt.headless","true")

I wonder if such a workaround could be implemented? I guess forcing headless for view.image.2d() should be fine in any case?

Cheers,
Rick

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

1 participant