LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-17-2006, 08:32 AM   #1
old-dog
LQ Newbie
 
Registered: Jun 2006
Location: Colorado
Distribution: suse 10.1
Posts: 2

Rep: Reputation: 0
X11 from non-graphic shell


I picked up a book on java and am playing with it on my SuSe 10.1 environment.

When running the java bytecode I compiled with javac from an x-term spawned from the kde environment - it runs fine.

When I attempt to run the same code from a shell outside the kde environment I get the following error:

1. "mybox# java HelloJava"

Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.

2. So I ran the following command from the command line
export DISPLAY=localhost:0.0

3. Run the code again. "mybox# java HelloJava"

Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'localhost:0.0' as the value of the DISPLAY variable.

I'm sure this is a simple configuration issue, will someone help me or direct me to the right HOWTO or tutorial.

Many Thanks in Advance

Johnny

========================================================
When you kick a dog around long enough,
even the most sweet tempered and patient,
eventually he will switch to linux . . . ;P

Last edited by old-dog; 11-17-2006 at 08:44 AM.
 
Old 11-17-2006, 09:59 AM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Do you have authorization to run on your x server (when you're on the console)?

To find out, go to the non-graphical console, and type
Code:
xterm -display 0:0
If you get error messages, you probably don't have authorization. If you check your screen, it should be running an xterm now.

To get authorization depends on your distro. The most basic way is use xauth and MIT-cookies to do something like
Code:
xauth add 0:0 . `mcookie`
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
X11 auto login and disable users shell - tricky business drkstr Slackware 10 08-29-2006 01:54 PM
Graphic Driver: How to set up Livna graphic support? Chuong Linux - Software 11 08-20-2006 01:15 AM
Core 4 - X11-devel complains about X11-libs which are installed Ephracis Fedora 3 09-05-2005 09:32 AM
how to start x11 in shell from knoppix-std lepricaun Linux - Newbie 3 05-04-2004 05:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration