I am running an application on an OSX which uses simple instance of
Color class. I get the following errors
My application (genGridNew.java) has this entry on line 47:
Color colorsReq = new Color(red, grn, blu);
Could anyone give me a hint on this? I really don't know what to do
here. The same program runs on a Linux platform. I tried display
settings ( I am not using mac console, I am running this trough an ssh
session). Thanks in advance..
If I understand correctly, you're running the program on a Mac OS X
system
that you've logged into via ssh from some other unspecified system that
I'll
just assume for now is some kind of *nix.
The program wants to connect to the window server -- that would likely
be
the box that you ssh'd from -- possibly to get color depth or some other
information from the window server that will be acting as the display.
The error says you don't have permission to do this.
Did you set/export/setenv your DISPLAY environment variable correctly?
I guess yes, else you'd get some complaint to that effect instead. Did
you set xhost permission to allow the OS X system to connect to this
other machine and use it as a window server?
Be aware that your program running under Java on Linux is using X to
do its drawing, but on OS X it's using Carbon/Cocoa & Quartz unless
you've done something (I have no idea what) to change that. It may
not work at all trying to display on an X-term.
If the program is small maybe you could post it, or reduce it to a
simple
test case and post that.
Stephen
kCGErrorRangeCheck : Window Server communications from outside of
session allowed for root and console user only
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:1586)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at
sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1437)
at java.awt.Toolkit.<clinit>(Toolkit.java:1458)
at java.awt.Color.<clinit>(Color.java:250)
at genGridNew.main(genGridNew.java:47)
--
"It is practically impossible to teach good programming
to students that have had a prior exposure to BASIC: as
potential programmers they are mentally mutilated beyond
hope of regeneration."
- Edsger W. Dijkstra, SIGPLAN Notices, v17 #5
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden