How to install DCEVM for Java 7 in Linux?
Asked Answered
F

4

9

The main site of DCEVM didn't clearly explain how to install DCEVM on Linux. Running "java -jar installer.jar" in Linux (when accessed via PuTTy) gave me the following exception.

[admin@LINUXBOX jdk1.7.0_55]$ java -jar DCEVM-full-7u79-installer.jar
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:207)
at java.awt.Window.<init>(Window.java:535)
at java.awt.Frame.<init>(Frame.java:420)
at javax.swing.JFrame.<init>(JFrame.java:224)
at com.github.dcevm.installer.MainWindow.<init>(MainWindow.java:43)
at com.github.dcevm.installer.Main.main(Main.java:46)
Exception in thread "main" 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:207)
at java.awt.Window.<init>(Window.java:535)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1757)
at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1832)
at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1697)
at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:667)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:638)
at com.github.dcevm.installer.Main.main(Main.java:51)

If required, I am also ready to use a Virtual Box installed Desktop Linux to try it, which then I can copy (patched JDK) into my original Linux box thereafter.

So, how can I install DCEVM on Linux (for Java 7)? Do I need a Desktop-based Linux for that?


EDIT: Here's the output of few commands suggested by the first answer by Sharad:
[admin@TESTBEDPEGSEARCH jdk1.7.0_55]$ echo $DISPLAY

[admin@TESTBEDPEGSEARCH jdk1.7.0_55]$ java -version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)


EDIT2: I am using DCEVM in Windows for quite a long time.
Fordham answered 15/6, 2016 at 5:35 Comment(0)
U
4

The DISPLAY variable is only set when a X11 session is active. When you login on a remote machine with ssh, this usually is not the case.

There are two possible solutions:

  • install a X server on Windows (e.g. XMing) and enable X11 forwarding in your Putty session (Connection > SSH > X11). This will show the installer on your Windows PC.
  • log in on the Linux host in a graphical session, this will automatically set the DISPLAY variable.
Unseasoned answered 28/6, 2016 at 20:1 Comment(1)
I am able to run the jar in a Linux graphical session. Thanks for the help.Fordham
M
5

Step 1:--Check for the display variable set on your machine using echo

echo $DISPLAY 

ensure It is set on :0

Step 2:-Check for your JAVA version Using

java -version

My Centos machine is reflecting:--

openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

Step 3:-- I run java -jar DCEVM-full-7u79-installer.jar command

It works for me.

Madel answered 15/6, 2016 at 6:16 Comment(1)
I updated the question with the output of the above steps. Please see above. What echo $DISPLAY supposed to print?Fordham
M
5

echo $DISPLAY should print :0 . If it is not printing :0 Then you should set display variable using this command "export DISPLAY=127.0.0.1:0.0" . I hope it will work

Madel answered 15/6, 2016 at 8:55 Comment(1)
I followed your steps. Now echo $DISPLAY prints 127.0.0.1:0.0. However, executing java -jar DCEVM-full-7u79-installer.jar prints error as Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using '127.0.0.1:0.0' as the value of the DISPLAY variable.Fordham
U
4

Note: I have not installed this but i happened to find a guide with video which may help you.

Please read the section with this heading Install DCEVM to hot redeploy more complicated changes

https://vaadin.com/blog/-/blogs/getting-started-with-vaadin-development-using-eclipse-maven

Unionist answered 28/6, 2016 at 13:42 Comment(1)
Thanks for posting the link of a Linux based DCEVM installation video. Very useful indeed.Fordham
U
4

The DISPLAY variable is only set when a X11 session is active. When you login on a remote machine with ssh, this usually is not the case.

There are two possible solutions:

  • install a X server on Windows (e.g. XMing) and enable X11 forwarding in your Putty session (Connection > SSH > X11). This will show the installer on your Windows PC.
  • log in on the Linux host in a graphical session, this will automatically set the DISPLAY variable.
Unseasoned answered 28/6, 2016 at 20:1 Comment(1)
I am able to run the jar in a Linux graphical session. Thanks for the help.Fordham

© 2022 - 2024 — McMap. All rights reserved.