[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Mac OS X folder permission problem or Java problem

Posted on 2011-10-10
Medium Priority
Last Modified: 2012-08-17
I am testing PHP with java on Mac OS X Server, when I running following PHP, no any response, is it related to Mac OS X folder permission problem or other issues !

PHP code

echo exec ("java -jar /var/www/uploads/delta/odt-compare-command.jar compare .$p1 .$fp2 .$p3",$results);
      echo $results;

When I run command line with non-root user, the following error message shown on terminal

Mon Oct 10 15:16:44 testingdomain java[11787] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Exception in thread "main" java.lang.InternalError: Can't connect to window server - not enough permissions.
      at java.lang.ClassLoader$NativeLibrary.load(Native Method)
      at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1823)
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1720)
      at java.lang.Runtime.loadLibrary0(Runtime.java:823)
      at java.lang.System.loadLibrary(System.java:1045)
      at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.awt.Toolkit.loadLibraries(Toolkit.java:1605)
      at java.awt.Toolkit.<clinit>(Toolkit.java:1627)
      at java.awt.Color.<clinit>(Color.java:263)
      at com.deltaxml.odf.comp.OdtComparator.<clinit>(Unknown Source)
      at com.deltaxml.odf.comp.OdtComparatorDriver.main(Unknown Source)
Question by:liyy
  • 2
LVL 47

Assisted Solution

for_yan earned 501 total points
ID: 36940908

I'm not sure about Mac, but it looks like similar to like  X Windows server does not allow to open window to the client - can't it be something similar
Usually xhost + command on the server or something  like that was helping me

LVL 47

Accepted Solution

for_yan earned 501 total points
ID: 36940923
LVL 86

Assisted Solution

CEHJ earned 249 total points
ID: 36940933
Does that particular Java program require a windowing  environment? If it doesn't, you might try running with the following:

echo exec ("java -Djava.awt.headless=true -jar /var/www/uploads/delta/odt-compare-command.jar compare .$p1 .$fp2 .$p3",$results);
      echo $results;

Open in new window


Author Comment

ID: 36953794

let me try it and feed back here.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month20 days, 3 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question