When I try to run .bin/elasticsearch, I get the following error:
could not find java in bundled jdk at /home/ubuntu/Elastic
Search/elasticsearch-7.8.0/jdk/bin/java
I have absolutely no idea what's going on. I know this topic has been created before, but I haven't found a way to fix. For java -version I get:
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~20.04-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
Can anyone help me please? Thank you!
The most probable reason for the above error is that JAVA_HOME is not set
To display JAVA_HOME variable path, run this command echo $JAVA_HOME
If nothing appears then follow the below steps:
To see all the java versions installed in Ubuntu, use this command:
sudo update-alternatives --config java
Set your java path using this. - export JAVA_HOME=<YOUR-JAVA-PATH>
I had the similar problem on linux, when I was running elasticsearch using
sh elasticsearch
I got the error
Elasticsearch: could not find java in bundled jdk at .../jdk/bin/java
Then I referred to the official document
and set ES_JAVA_HOME environment variable.
After running elasticsearch again, I got the following message and it ran successfully
ignoring JAVA_HOME=/project/jdkForElasticSearch/; using ES_JAVA_HOME
Note: After setting environment variable, restart your terminal to reflect the updated value in it.
Related
Hello guys this is the first time i write a question here and not just read an answer.
My problem is that I have a Macbook with Sierra on it and hava a tomcat with my wsdl file and i wanted to generate my classes with axis2 so i started the wsdl2java.sh in Eclipse and till that point everything works fine.
But then it says:
You must set the JAVA_HOME variable before running Axis2 Script.
but when i open a terminal and lookup for
echo $JAVA_HOME it will say:
/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
and also when i type in java -version i get this result:
java version "1.8.0_101" Java(TM) SE Runtime Environment (build
1.8.0_101-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
my question is why does eclipse not found my JAVA_HOME path?
i allready started eclipse as sudo directly through the terminal and also tried to change the .bash_profile but nothing works for me
I hope i described the Problem so that you can help me !
thanks a lot
As Minh Kieu recommended in the comments, I added this to the shell script of wsdl2java:
export JAVA_HOME=$(/usr/libexec/java_home)
Then I restarted Eclipse and now it worked.
I am trying to get Spark running locally. When I launch it, I get the following error, suggesting something is weird with my java installation (or the path to it). This is on Mac OS Yosemite.
line 190: /usr/java/jdk1.7.0_51/bin/java/bin/java/bin/java: No such file or directory
Any suggestions how to remedy this? Let me know if you need more info (I don't know where to start)
Edit: Clearly there is a setting wrong somewhere, I'm just not sure where.
In my bash-profile, there is a line
JAVA_HOME=usr/bin/java
Also when I run java -version I get:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
Solution:
Something was weird with where Spark was looking for Java. Not sure how the default is set, but I found a way to override it.
1) In terminal run this and copy and paste the results. This gives you the path of your Java installation.
$(dirname $(readlink $(which javac)))/java_home
2) In the spark-whatever/conf folder, make a file "spark-env.sh" and write "export JAVA_HOME="
I am trying to install GLassfish server using execuatable glassfish-3.1.2.2-windows.exe
When i try to open the executable, after the message Launching Java 2(TM) Runtime Environment nothing happens.
I already have Java installed.. if i am correct i tried getting the version from cmd prompt.. it has given me the 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)
Now m not sure if the problem lies with environment variable.. but i have tried setting up that too.. but still the same issue.
Seems like m missing something..
Please help...
Seems like this is an issue with the installer. You can specify your Java installation by passing it with a parameter like this:
*GLASSFISH_INSTALLER_NAME* -j *YOUR_JAVA_INSTALLATION_PATH_TO_JDK*
Example:
ogs-3.1.2.2-windows.exe -j "C:\Program Files\Java\jdk1.7.0_80"
Simply go to the location of the installer on command prompt and type above.
This method worked perfectly for me.
Seems like this is an issue with the installer which seems to look for a Java 1.6 installation.
You can specify your Java installation by passing it with a parameter like this:
glassfish-3.1.2.2-windows.exe -j <YOUR_JAVA_INSTALLATION>
Example:
glassfish-3.1.2.2-windows.exe -j "C:\Program Files\Java\jdk1.7.0_51"
If even this doesn't work you can get the ZIP version of GlassFish and extract it in the desired folder.
See also:
GlassFish as windows service
Error creating glassfish as a service
I could not get a solution to this issue, but used an alternative, i.e downloaded the glassfish server zip file.. extracted it.. and then tried running the application server. It worked.
This is the issue with the path of the command. There are no spaces allowed in the path. You must use the double quotes like:
glassfish-3.1.2.2-windows.exe -j "C:\Program Files\Java\jre7"
I am trying to get jmxtrans to work yet I get the below on ubuntu 12.04 and using openjdk 7.
/usr/share/jmxtrans# java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
/usr/share/jmxtrans# ./jmxtrans.sh start /var/lib/jmxtrans/kafka.json
Cannot execute /usr/lib/jvm/default-java/bin/jps -l!
What does the above mean?
It seems that the jps file can't be found in the /usr/lib/jvm/default-java/bin directory. It is available in the '-devel' packages if you want to install those (yum install java-1.7.0-openjdk-devel, apt-get install openjdk-7-jre-devel). It could also be that your JAVA_HOME is not pointing to the correct place if you have multiple java versions installed.
You should not need it however, regular ps works fine. You can add a variable to your configuration that says export USE_JPS=false. The configuration can be found in /etc/default/jmxtrans.
Check out these issues for more information:
https://github.com/jmxtrans/jmxtrans/issues/89
https://github.com/jmxtrans/jmxtrans/pull/109
I am pretty novice when it comes to Ubuntu but I am trying to follow along with the install instructions for Cloudera located here.
At step 1, I am getting to following error:
brock#brock-hpserver:~$ sudo -u hdfs hdfs namenode -format
Error: JAVA_HOME is not set and could not be found.
However, although I could be wrong, I believe I have everything set up properly:
brock#brock-hpserver:~$ echo $JAVA_HOME
/usr/lib/jvm/java-6-openjdk-amd64
brock#brock-hpserver:~$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:JAVA_HOME/bin
And finally my java version:
brock#brock-hpserver:~$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
Any help will be greatly appreciated. I simply just want to poke around and learn Hadoop on a spare machine at home.
I met the same problem, just add JAVA_HOME="directory_to_JDK" setting into the /etc/environment, and it works.
The JAVA_HOME is defined for your process, but not for the process in which the sudo is running. export the JAVA_HOME definition. I don't recall the syntax, but I believe it's similar to export JAVA_HOME=/drive/dir1/dir2/java
If that does not work, JAVA_HOME can be defined at the system level, for all processes. It's been a long time, I don't recall how. But hopefully there's enough here to allow you to Google.
Here's a SO link about export.