LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-25-2009, 04:26 AM   #1
dj32
LQ Newbie
 
Registered: Dec 2009
Posts: 16

Rep: Reputation: 0
[Ubuntu 9.10]Java error when starting scripts.


Hello there,and Merry Christmas.
I have a serious problem with java and i can't run my gameserver.

my java version is this

java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02, mixed mode)

And when i am trying to run my gameserver scripts i get this error.

root:~# /home/l2jserver/login # ./L2JConfig.sh
Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
at java.awt.Window.<init>(Window.java:431)
at java.awt.Frame.<init>(Frame.java:403)
at java.awt.Frame.<init>(Frame.java:368)
at javax.swing.JFrame.<init>(JFrame.java:163)
at net.sf.l2j.configurator.ConfigUserInterface.<init>(ConfigUserInterface.java:120)
at net.sf.l2j.configurator.ConfigUserInterface$1.run(ConfigUserInterface.java:112)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

This is not my desktop computer but my remote server.
I would be really gratefull if someone can help me to resolve this issue.Thank you and again Merry Christmas
 
Old 12-25-2009, 04:58 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

As stated by the error message: No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Try this before starting the script: export DISPLAY=hostname:0.0 (hostname being the name of your machine/host).

Hope this helps.
 
Old 12-25-2009, 05:07 AM   #3
dj32
LQ Newbie
 
Registered: Dec 2009
Posts: 16

Original Poster
Rep: Reputation: 0
Okay i did as you told me,

But it is still not working,now it gives me this message

root:~# /home/l2jserver/login # ./L2JConfig.sh
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:89)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.Toolkit$2.run(Toolkit.java:834)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826)
at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:128)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1556)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:130)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1591)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:542)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:582)
at net.sf.l2j.configurator.ConfigUserInterface.main(ConfigUserInterface.java:93)

Last edited by dj32; 12-25-2009 at 05:14 AM.
 
Old 12-25-2009, 05:19 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

You did not mention that you are doing this on a remote host and need to ssh into that host. (that info was removed from the previous post while I was replying......)

Ssh X forwarding is what you need, take a look at these 2 sites for an explanation and how to set it up:

SSH - X11 Forwarding
Linux XDMCP HOWTO - 3. X11 Forwarding using SSH

Do use the xclock example mentioned in both articles first. If that works go back to your script and see if that works.

Hope this helps.

PS: I do assume this is linux <-> linux and _not_ windows <-> linux.
If the latter is the case: You need an X Server for windows as well (I don't have too much experience with that, but XMing comes to mind).
 
Old 12-25-2009, 05:27 AM   #5
dj32
LQ Newbie
 
Registered: Dec 2009
Posts: 16

Original Poster
Rep: Reputation: 0
Yes,i am using Windows xp and connecting to my ubuntu machine using putty shh client,i guess i will have to install that XMing thing you gave me link to my win xp computer.
 
Old 12-25-2009, 05:49 AM   #6
dj32
LQ Newbie
 
Registered: Dec 2009
Posts: 16

Original Poster
Rep: Reputation: 0
Well in the first guide,i clicked ./configure and it gave me this

-bash: ./configure: No such file or directory


after,the /etc/ssh2/sshd2_config file does not exist in my ubuntu server
 
Old 12-25-2009, 06:37 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

You can use ssh instead of the ssh2 notation.

ssh2 just tells you that protocol version 2 is used (version 2 is preferred to version 1). Take a look at your /etc/ssh/sshd_config, there will be an entry like this:
Protocol 2 (use version 2 only) or Protocol 2,1 (use version 2 and fall back to version 1 if version 2 is not supported).

Hope this clears things up.

BTW: ./configure is only needed if you want to install ssh from source (which you don't want to do, it is already installed and X forwarding is probably compiled in already). You need to look at the sshd_config file options.
 
Old 12-25-2009, 07:18 AM   #8
dj32
LQ Newbie
 
Registered: Dec 2009
Posts: 16

Original Poster
Rep: Reputation: 0
It is already in Protocol 2, what to dow now?
 
Old 12-25-2009, 07:42 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
What are you trying to accomplish at the moment?

You did tell that you have a windows <-> linux setup, then why bother with the first 2 links I gave in post #4 (both are linux <-> linux solutions)? You should focus on a windows <-> linux solution (XMing being one of those, as stated earlier).

Here's a Document (pdf) that explains xming (general explanation and install).

If you do want a linux <-> linux solution: Follow the rest of the link(s) I gave. The ssh protocol version is not the important part, the rest is.
 
Old 12-25-2009, 07:46 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi again,

I found this (googled "xming ubuntu ssh"): Howto Easily run an Xserver under Windows - Ubuntu Forum.

Could be of help.
 
Old 12-25-2009, 08:37 AM   #11
dj32
LQ Newbie
 
Registered: Dec 2009
Posts: 16

Original Poster
Rep: Reputation: 0
I am just trying to undertstad all this guides,but nothing works for me ,i don;t know how to use XMing nor what command to put in putty to fix the problem,i am very confused.Anyways Drruna thank you for your help,it's my fault that i can't make it work.
 
Old 12-25-2009, 08:49 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

I would suggest to start again and only focus on the link I gave in post #10. It is Ubuntu specific (which I assume you use, you did post in LQ's Ubuntu forum) and a lot of people found it a good guide.
 
  


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
[Ubuntu 9.10]Java error when starting scripts. dj32 Linux - Newbie 1 12-25-2009 04:59 AM
Starting scripts as non-root rabalder321 Linux - Newbie 4 12-09-2005 08:08 AM
Error starting NetBackup: Cannot connect to the NB-Java authentication service charleycat Linux - Software 1 05-25-2005 08:13 AM
Some rc.d Scripts Not Starting granatica Linux - Software 4 03-17-2004 05:07 PM
Scripts for Starting Window Manager jasonmiu Red Hat 0 09-19-2003 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 07:39 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