Logstash cannot run - logstash

I cannot run logstash on my windows-10 machine. What I have done so far:
Unzipped logastash-oss-7.2.0.zip
Verified that I have java installed and on path via java -version:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
openjdk version "1.8.0_212"
OpenJDK Runtime Environment Corretto-8.212.04.2 (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM Corretto-8.212.04.2 (build 25.212-b04, mixed mode)
When I run in unzipped ./bin directory logstash --version
"warning: ignoring JAVA_TOOL_OPTIONS=$JAVA_TOOL_OPTIONS"
warning: ignoring JAVA_OPTS=-Dfile.encoding=UTF-8; pass JVM parameters via LS_JAVA_OPTS
There is nothing in logs. What I am doing wrong, why there is no output ?
Another java programs runs fine and I have also set LS_JAVA_OPTS, but this does not helped.

Related

Kafka on RHEL gives me "Classpath Is Empty"

I'm trying to install Kafka 2.6.0 on a Red Hat VM. When I try to start Zookeeper, I get:
"Classpath is empty. Please build the project first..."
I have the following Java Version, which is Java 8 as far as I understand:
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-b10)
OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode)
Is there something I need to do to set a "Classpath" environment variable?
I updated .bashrc for my users and the Classpath error went away.
Source: https://computingforgeeks.com/how-to-set-java_home-on-centos-fedora-rhel

How do I fix JavaFX runtime components are missing?

I have the following installed on Ubuntu 18.04.1 LTS:
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)
javafx.runtime.version=8.0.161
javafx.runtime.build=b00
However I try to run the sample java application that uses javafx I get the following error:
$ java -jar Untitled.jar
Error: JavaFX runtime components are missing, and are required to run this application
I have tried to run it in Eclipse, Intelli, and in the terminal with the same error.
I have set the classpath
:~$ echo $CLASSPATH
/usr/share/java/openjfx/jre/lib/ext/jfxrt.jar:.
I have copied all of the javafx files to the current directory.
I have tried everything I can find on the internet.
Does anyone know how to fix this?
On Ubuntu 18.04 with openjdk-11-jre and openjfx installed you could use:
% java --module-path /usr/share/openjfx/lib --add-modules ALL-MODULE-PATH \
-jar Untitled.jar
There is more information on how to run JavaFX programs at the openjfx.io site.

How to install DCEVM for Java 7 in Linux?

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.
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
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.
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.
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

Why can not I run Intellij on Linux Mint for Java version error?

When I try to run intellij, it shows the following message-
Can not start under java 1.7.0_51-b13:Java 1.8 or later is required!
But when I checked the version of the Java in the machine-
java -version
I get-
java version "1.8.0_60" Java(TM) SE Runtime Environment (build
1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
What could be the reason for not working this?
Newer versions of IntelliJ IDEA explicitly require Java 8 to run.
Some things that can be done:
Uninstall older versions of Java
Ensure that which java points to the correct version of Java
Ensure that Java 8 is selected via update-alternatives --config java
Check the variables IDEA_JDK, JDK_HOME, and JAVA_HOME, and be sure they don't point to Java 7. If all else fails, IDEA defaults to whichever java is on the path, so unsetting those variables may be a viable option.
Can you check if you have a JAVA_HOME env variable set ? If yes, it might use this version instead of the java binary available in your path.

How to use java in cmd to get a stable output?

It sounds a strange question, but there is a reason.
I'm working to use VC++ code auto find out the max memory that JVM can use . I want to use java cmd to launch JVM simply.
My thoughts was:
Running java -Xmx3999G -version like commands and the output, if the JVM is launched successful, there will be something like
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
Otherwise it will output something like
Error occurred during initialization of VM Unable to allocate
131039232KB bitmaps for parallel garbage collection for the r equested
4193255424KB heap. Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Now the key is that how to know whether the JVM is launched or not ? I can find some keywords in output like java version to get know it launched. But the output would be unstable if java update or something else.
The stable way I can think out is running a java code which has unchanged output (just print a simple string in main function can do this). But it needs me to package a jar file in my project's rc and extract it to temp folder and run it in cmd. I think it is little complex.
So I'm asking for help here , can any java command gives me a stable output if JVM is launched ?
How about java -help? Its output would always contain a list of commands, which surely contains a stable subset.
Other than that, you may still decide to retest once a new JDK version appears. It is imho highly unlikely that there are bigger changes in the output. Here's the output from java version 1.6.0_45:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build
1.6.0_45-b06) Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)
and here from java version 1.7.0_75:
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) Client VM (build 24.75-b04, mixed mode, sharing)
These look very similar to 1.8.x except for the version number itself.

Resources