installation error for elasticsearch on windows7 - java

I have been trying to setup elasticsearch in windows7 machine by following https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html
I was able to download, unzip but when running ./elasticsearch, I get the below error,
Error: Could not find or load main class
org.elasticsearch.tools.JavaVersionChecker
Elasticsearch requires at least Java 8 but your Java version from C:\Program
Files\Java\jdk1.8.0_131/bin/java does not meet this requirement
I have verified Java versions installed and they look fine,
$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
$ javac -version
javac 1.8.0_131
Can someone point out where I am wrong ?

In run Elasticsearch in Windows, you should run with elasticsearch.bat not ./elasticsearch directly:
And now we are ready to start our node and single cluster (Windows users should run the elasticsearch.bat file):

Seems like you don't have right permissions. Try to set them to 774 and check again:
sudo chmod 774 -R elasticsearch-6.3.2/

Related

A working Java 8 is required to run Solr?

solr version is 6.0.0
When I run
>bin/solr -e example
error with
Java not found, or an error was encountered when running java.
A working Java 8 is required to run Solr!
Please install Java 8 or fix JAVA_HOME before running this script.
Command that we tried: 'java -version'
Active Path:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
my java version is
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
and my PATH is
/opt/java/bin:/opt/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
I edit the bin/solr
116 JAVA=java
to
116 JAVA=/opt/java/bin/java
then it works!
Ran into a similar issue on 5.5, this link helped me: https://www.garysieling.com/blog/install-solr-ubuntu

Why is Git Bash not using the correct Java path as defined in the PATH environment variable?

In an instance of Git Bash, typing in java -version gives me:
Error: could not open 'C:\Program Files (x86)\Java\jre7\lib\i386\jvm.cfg'
However, my actual Java path is in D:\Program Files\Java\jdk1.8.0_45\bin. This is shown in my %PATH% variable if I type in either echo $PATH or env | grep PATH.
Where is Git Bash getting this nonexistent Java path from?
P.S.
To add on to this, running java -version in the Command Prompt gives me the correct output:
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)
Check if you have some old java.exe, javaw.exe, javaws.exe in the c:/windows/system32 folder, as mentioned in "Java path..Error of jvm.cfg".
I just checked with Git 2.6.3 on Windows, where I don't have anything in c:/windows/system32, and the result is consistent between:
git bash:
vonc#bigvonc MINGW64 /
$ java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
and CMD:
C:\prgs\git\PortableGit-2.6.3-64-bit>java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
Both report the same java at the same spot:
vonc#bigvonc MINGW64 /
$ which java
/c/prgs/jdk/jdk-7u51-windows-x64/bin/java
C:\prgs\git\PortableGit-2.6.3-64-bit>which java.exe
C:\prgs\jdk\jdk-7u51-windows-x64\bin\java.exe
Conclusion: upgrade to the latest git for windows.
If you are trying to manually set JDK, then please check if you haven't missed the Oracle Java (C:\ProgramData\Oracle\Java\javapath) in Path Environment Variable under System Variables, remove it and java -version should work just fine.
Check the PATH variable in your .bash_profile file to make sure it reflects the correct version of java. The file is usually in your home directory C:\Users\\{HOME}\\.bash_profile
It will happen when you have running an IDE with another set of JDK instances. The better way to resolve this is set you JDK home in path and make it available in last row. This is working for me.

Hadoop: JAVA JPS tool not working

I have the Hadoop installed everything looks working fine, except jps.
every time run jps,(I have Oracle Java jdk1.8.0_31 installed) I get this:
The program 'jps' can be found in the following packages:
* openjdk-7-jdk
* openjdk-6-jdk
Try: sudo apt-get install <selected package>
anyone can help? really appreaciate.
here is my java version:
java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
Write "which java", you'll get the path to your java, and in the bin directory look for "jps".
If you find jps there then, perform the below step:
ln - s /usr/bin/jps
OR
You can add bin directory to the class path

cassandra 2 complaining about Java 7 when I have Java 7 installed

$ cassandra
Cassandra 2.0 and later require Java 7 or later.
OK, what's going on in that part of the init script?
java_ver_output=`"${JAVA:-java}" -version 2>&1`
jvmver=`echo "$java_ver_output" | awk -F'"' 'NR==1 {print $2}'`
JVM_VERSION=${jvmver%_*}
JVM_PATCH_VERSION=${jvmver#*_}
if [ "$JVM_VERSION" \< "1.7" ] ; then
echo "Cassandra 2.0 and later require Java 7 or later."
exit 1;
fi
Hmm, if I get the version at the command line:
$ java_ver_output=`"${JAVA:-java}" -version 2>&1`
$ echo $java_ver_output
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)
$ JVM_VERSION=${jvmver%_*}
$ echo $JVM_VERSION
1.7.0
If I run which java:
$ which java
/usr/bin/java
If I put that line in the script:
/usr/bin/java
The frustrating part here is that I've got this running in the past but since I bounced the server I can't get cassandra to start.
So I'm confused here, how is Cassandra confused about what version of Java I'm running? How do I get cassandra running? Is 1.7.0_55 not Java 7 (I don't get Java's naming convention)?
I got the same error message when trying to start Cassandra. But I notised that I only got the error when starting Cassandra as root. It worked when I started Cassandra as my local user.
It turned out that java only was configured for my local user:
$ java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
$ sudo java -version
sudo: java: command not found
This fixed the problem:
Tell the system that you have JRE installed (update usr/local/java/jre1.7.0_60/bin/java to your current path):
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0_60/bin/java" 1
Set the new JRE as default:
$ sudo update-alternatives --set java /usr/local/java/jre1.7.0_60/bin/java
Now java is installed for root and Cassandra can be started as root without the error message.
Per documentation: http://wiki.helioviewer.org/wiki/Apache_Cassandra_Installation
Set JAVA_HOME
Make sure JAVA_HOME is set: echo $JAVA_HOME
So make sure JAVA_HOME is pointing to /path/to/jdk7
To resolve this problem I changed $JAVA_HOME environment variable to the path I found it from:
System Preferences -> Java -> java (tab in Java Control Panel) -> View -> Path
I had two version of java and the default one was the old version of java.
See this CASSANDRA-11716 issue. The solution posted there worked for me.
Nothing above worked for me.I was trying to run cassandra with supervisor and was getting java error.So I figured out that I had to just set java path in cassandra.in.sh. I just had to set JAVA_HOME=/usr/local/jdk1.8.0_171 and save it and this worked for me.
I have faced a similar issue when installing DSE 4.6 on Linux. Issue is resolved when you set JAVA_HOME (as root) to the directory where JRE 1.7.x installed.
There appears to be a newer issue now that Java 7 update 101 has been released. I installed this version which broke Cassandra:
yum install java-1.7.0-oracle-1.7.0.101-1jpp.1.el7.x86_64
Installing a previous version (update 99) fixed the issue:
yum install java-1.7.0-oracle-1.7.0.99-1jpp.1.el7.x86_64
I'm guessing somewhere in the cassandra startup script a Regex is written for 2 characters in the update version, not 3.
This is caused by a bug in Cassandra: https://issues.apache.org/jira/browse/CASSANDRA-11661

Weblogic10.3.5 install: Unrecognized option: -d64

Im trying to set up weblogic in my machine.
I downloaded from http://www.oracle.com/technetwork/middleware/ias/downloads/wls-main-097127.html.
My PATH looks like this, C:\Program Files\Java\jdk1.5.0_22\bin;
Java - version in cmd prompt gives this,
C:\setups>java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-b03, mixed mode)
Now, when i execute the weblogic jar file using the command as specified in the oracle documentation, C:\setups>java -d64 -jar wls1035_generic.jar , I get the below error.
Unrecognized option: -d64
Could not create the Java virtual machine.
How should i get rid and execute the jar file to install weblogic? pls help.
I was having this issue. It happened because I had a 32bit JDK and not the 64bit JDK that was required by the weblogic install package
To check what version you have, you type the following in your terminal
java -d64 -version
If you get an error then that is your issue, proceed as below:
You can find the 64bit jdk at: Oracle
I think to avoid conflicts you might want to delete your current JDK

Categories