0

I would like to run a jar file extracted from my java project to be run on a Linux server I connect through SSH Tunneling. There are few problems, first there is something wrong with the Display: I get the error

No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
    at java.awt.Window.<init>(Window.java:437)
    at java.awt.Frame.<init>(Frame.java:419)
    at java.awt.Frame.<init>(Frame.java:384)
    at javax.swing.JFrame.<init>(JFrame.java:174)
    at random_v2.v2Frame.<init>(v2Frame.java:127)
    at random_v2.Wrapper.main(Wrapper.java:25)

and second is that I am not sure if I have to install other applications as well. In my code, the java program needs to get run other applications like weka, do I have to install weka with the same directory name and specs that is in my mac? I appreciate your help in advance. Best wishes

Alex W
  • 37,233
  • 13
  • 109
  • 109
Ramin
  • 891
  • 2
  • 10
  • 16
  • 1
    possible duplicate of [Getting a HeadlessException: No X11 DISPLAY variable was set](http://stackoverflow.com/questions/5218870/getting-a-headlessexception-no-x11-display-variable-was-set) – Damian Leszczyński - Vash Jul 02 '12 at 16:37

2 Answers2

1

Assuming you're tunneling into this unix box using PuTTY:

Make sure X11 forwarding is enabled in your PuTTY settings.

enter image description here

Alex W
  • 37,233
  • 13
  • 109
  • 109
0

Connect via command line using this command:

ssh -X user@server

The -X option enables X11 forwarding.

elias
  • 15,010
  • 4
  • 40
  • 65