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.
Related
I am trying to package a jar file into an executable file using the jpackage tool in Java, but the command is not recognized in the command prompt using Windows 10 and Java version:
> java --version
java 17.0.1 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
I have the full JDK installed and the command javac is recognized.
I checked my computer with the "where java javac jpackage" command and it only found the first two in the CommonFiles folder.
I looked in the folder path "ProgramFiles\Java\jdk-17.0.1\jmods" and both the "jdk.jlink.jmod" and "jdk.jpackage.jmod" files are present.
Can someone please help me figure out why the tool isn't recognized by Windows?
I found the issue to be the way my Environment Variables were set up for Java. To fix my problem, I went into the JAVA_HOME variable and changed the entry from
C:\ProgramFiles\Java\jdk-17.0.1\lib
to
C:\ProgramFiles\Java\jdk-17.0.1
Next I updated the path variable to include "%JAVA_HOME%\bin". Before I had it listed as C:\ProgramFiles\Java\jdk-17.0.1\bin. Both of these changes were made under the System variables using the "Edit" button. I want to thank dave_thompson_085 for pointing me in the right direction.
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.
I've always used Google2SRT, a light software to download subtitles from Youtube. Now it no longer works: "Startup Error: Failed to find Java VM".
I have Java installed, I have Netbeans installed and working, I have never had any Java related issues.
I've tried reinstalling everything, I've tried creating a JAVA_HOME and JRE_HOME System variable and pointing it to "C:\Program Files\Java\jre1.8.0_191" according to this tutorial: https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html
It felt odd because I didn't even had this environment variable previously. I have no idea what's the issue.
I've tried uninstalling Netbeans and other programming tools as well.
I'm on Windows 7 x64.
java -debug -version > "%userprofile%\desktop\javaDebug.log" 2>&1 returns:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
I have also tried setting maximum heap size in _JAVA_OPTIONS
System Variables
Just go to the install dir (e.g. C:\Program Files (x86)\Google2SRT), open a cmd.exe, cd to the above folder and type java -jar Google2SRT.jar. You don't need the .exe
This should work, provided you have java installed. Check by typing java -version in the cmd.
OK... This is kind of odd. So, yesterday, on my new computer, I installed the latest JDK 8 for Windows 7. I input it to environmental variables, I did everything correctly, and I know it for sure because it worked yesterday. I compiled multiple .javas. But now today, I use the javac on any .java, and the CMD prompt just goes back to "C:\Users\Home Computer>"
I've restarted, hours of research, but this problem seems new. Even uninstalled and reinstalled JDK. Any ideas? Thanks in advance.
Command Prompt Screenshot
Open CMD, type in "java -version", press Enter & show us what you got there. Does it look like:
C:\Users\W>java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
C:\Users\W>
You can debug it step by step following the official guide of Oracle or external document:
https://docs.oracle.com/javase/tutorial/essential/environment/paths.html
https://www3.ntu.edu.sg/home/ehchua/programming/howto/JDK_Howto.html
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="