I have downloaded java8 and then created a folder "java" in "/usr/local". Later I set the JAVA_HOME and PATH using export.
echo $JAVA_HOME output /usr/local/java/jdk1.8.0_20
Now, when I open terminal and type java -version it prompts to choose any package from below to install java. But when I do $JAVA_HOME/bin/java -version it gives
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b23)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b22, mixed mode)
and when I run
sh /home/SOAPUI_HOME/soapui-4.0.1/bin/soapui.sh gives
================================
=
= SOAPUI_HOME = /home/SOAPUI_HOME/soapui-4.0.1
=
================================
/home/SOAPUI_HOME/soapui-4.0.1/bin/soapui.sh: 141: /home/SOAPUI_HOME/soapui-4.0.1/bin/soapui.sh: java: not found
SoapUI doesn't use JAVA_HOME in its launcher .sh files. You could add /usr/local/java/jdk1.8.0_20/ before java on line 141 (if you are using SoapUI 4.0.1, but I would suggest to upgrade to 5.0.0, then it's line 72).
Another solution would be to to make sure your java installation is the PATH variable.
Third, and easiest in my opinion, is to download the installer version of SoapUI. It is a .sh file which installs both SoapUI and Java.
I turned off the Internet Connection, because in the logs I saw many HttpConnection errors. Launch SOAP UI from terminal
sh /Applications/SoapUI-5.1.3.app/Contents/java/app/bin/soapui.sh
and then turn on the internet again.
When I want my systems Java version to overrule the SoapUI Java version, I rename the jre folder within the soapUI folder to temp or whatever. After that SoapUI picks up the Java version that you are running on your system.
Related
I have trouble when trying to open my jar files with the following command:
java -jar software.jar
They load until a certain point and then nothing happens.
I deinstalled default-jdk and OpenJDK with synaptic and re-installed it with apt-get, but nothing changed. I had a similar problem one month ago and solved it (apparently only temporarly) by deleting the package gcj-5-jre-lib (5.4.0-6ubuntu1~16.04.4) (Java runtime library for use with gcj (jar files))
The following outputs will help:
java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
javac -version
1.8.0_131
My variables $JAVA_HOME and $JRE_HOME were correctly added to my $PATH.
I'm on Ubuntu 16.04
EDIT
Here is an example of what I get when I try to start PhyDE.jar
java -jar PhyDE.jar
Welcome to PhyDE 0.9971!
Reading preferences.
Creating PhyDE-Application window
Checking for updates...
You are using the latest version of PhyDE
Done with checking for updates
When checking the core use with the command top I see that the process is active, but the user interface does not open as it usually does. I am located in the folder where the jar file is, and same happens with other jar files.
I am trying to encrypt a database password for my Java EE Application in the terminal. according to this tutorial
The steps are as follows:
Change directory to your domain’s bin folder (For Eg. cd WLS_home\user_projects\domains\mydomain\bin)
Use setDomainEnv.cmd/sh script to setup the environment
Run java weblogic.security.Encrypt which will prompt for the password and will print the encrypted value in stdout.
However, when I execute 'java weblogic.security.Encrypt', I am presented with the following:
Error: Could not find or load main class weblogic.security.Encrypt
I am developing my project in Eclipse and have configured my Weblogic-12.1.3 server in Eclipse. I am not sure why this error is happening, but I expect its because my java version is 1.8, and maybe it expects me to use java 1.6 which I think comes with Weblogic installation.
java -version
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)
You must type
cd WLS_home/user_projects/domains/mydomain/bin/
. ./setDomainEnv.sh
You must use two separate dots, that should do the trick!
I am using Java 8 with WebLogic 12.1.3 on Linux. I had to add some classpath entries, but it worked like this:
java -cp /home/devuser/Oracle/Middleware/Oracle_Home/wlserver/modules/features/*:/home/devuser/Oracle/Middleware/Oracle_Home/wlserver/modules/* weblogic.security.Encrypt
I had the same issue when I set set enableHotswapFlag= to true. please leave this flag empty and try.
I currently have CDH 5 installed on CentOS 6.5 with java jdk1.7 and I am trying to get CDH to use jdk1.8.
I do know that Java 1.8 is not a recommended version of CDH, but it is only a test cluster, so it isn't a big deal.
I have installed both Java 1.7 and Java 1.8 from Oracle's website using the RPM installation, so both versions of Java are currently under /usr/java. Using ls -ld my Java directory looks like:
/usr/java/default -> /usr/java/latest
/usr/java/jdk1.7.0_75
/usr/java/jdk1.8.0_31
/usr/java/latest -> /usr/java/jdk1.8.0_31
I also have script set up in /etc/profile.d to set $JAVA_HOME to /usr/java/default. The contents of my profile.d script:
export JAVA_HOME=/usr/java/default
export PATH=${JAVA_HOME}/bin:${PATH}
So when felt that I have this right, I run:
$ which java
/usr/java/default/bin/java
Telling me that it is pointing to the version of Java symlinked in default. And to determine which version of java is running, I run:
$ 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)
And I can see that I have Java 1.8 currently running.
Everything seems great, except when I try to start a Hadoop service. The easiest to start is ZooKeeper, because it only has one service. HDFS has multiple servers so it is more work that to just start and stop ZooKeeper.
Starting ZooKeeper is done with the following command:
$ sudo service zookeeper-server start
Then to check which version of java it is running, I search the running processes list for java:
$ ps -ef | grep java
495 7170 1 7 12:27 ? 00:00:00 /usr/java/jdk1.7.0_75/bin/java -Dzookeeper.datadir.autocreate=false -Dzookeeper.log.dir=/var/log/zookeeper -Dzookeeper.root.logger=INFO,ROLLINGFILE -cp /usr/lib/zookeeper/bin/../build/classes:/usr/lib/zookeeper/bin/../build/lib/*.jar:/usr/lib/zookeeper/bin/../lib/slf4j-log4j12.jar:/usr/lib/zookeeper/bin/../lib/slf4j-log4j12-1.7.5.jar:/usr/lib/zookeeper/bin/../lib/slf4j-api-1.7.5.jar:/usr/lib/zookeeper/bin/../lib/netty-3.2.2.Final.jar:/usr/lib/zookeeper/bin/../lib/log4j-1.2.16.jar:/usr/lib/zookeeper/bin/../lib/jline-0.9.94.jar:/usr/lib/zookeeper/bin/../zookeeper-3.4.5-cdh5.3.0.jar:/usr/lib/zookeeper/bin/../src/java/lib/*.jar:/etc/zookeeper/conf::/etc/zookeeper/conf:/usr/lib/zookeeper/*:/usr/lib/zookeeper/lib/* -Dzookeeper.log.threshold=INFO -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /etc/zookeeper/conf/zoo.cfg
I know that runs off the screen, bu the important part is that Zookeeper is being started by /usr/java/jdk1.7.0_75/bin/java.
To fix this, I have tried a few things:
Looking at the conf files for Hadoop and ZooKeeper under /etc/hadoop/conf and /etc/zookeeper/conf, respectively.
I found nothing setting JAVA_HOME.
Looking at the /usr/bin/zookeeper script to see if JAVA_HOME was set elsewhere,
I did find the script /usr/lib/bigtop-utils/bigtop-detect-javahome has the ability to set JAVA_HOME, but my profile.d script overrides that.
Manually moving /usr/java/jdk1.7 to /tmp.
Sadly, this is the only thing that works. When I move the jdk1.7 dir to another directory, and start ZooKeeper, it will use Java 1.8. Moving the jdk1.7 dir back, reverts to ZooKeeper using Java 1.7.
Has anyone dealt with this problem and does anyone know how to deal with this? I feel that I have Java set up correctly, but something is telling ZooKeeper/Hadoop to use an old version of Java?
I came here because I was looking for ways to upgrade JDK from 1.7 to 1.8 on the latest Coudera QuickStart VM 5.8 (can't believe they still ship it with JDK1.7 by default!). The hints and suggestions in the above answers helped tremendously - but since they were not listing complete steps to achieve the upgrade - I thought I would add that to help others like me.
So, here is a complete set of steps to upgrade Cloudera QuickStart VM from JDK1.7 to 1.8:
check your current JDK version - out-of-the-box it is:
[cloudera#quickstart ~]$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
download desired version of JDK1.8.xx - in my case: jdk-8u111-linux-x64.tar.gz
as user 'cloudera':
untar and move the resulting jdk1.8.0_111 dir to the /usr/java dir:
tar xzf jdk-8u111-linux-x64.tar.gz
sudo mv -f jdk1.8.0_111 /usr/java
shutdown all Hadoop services:
$ for x in `cd /etc/init.d ; ls hadoop-*` ; do sudo service $x stop ; done
update bigtop-utils file - set JAVA_HOME to your new JDK:
sudo vi /etc/default/bigtop-utils
updated lines:
# Override JAVA_HOME detection for all bigtop packages
export JAVA_HOME=/usr/java/jdk1.8.0_111
update 'cloudera' user's .bash_profile - export JAVA_HOME and add update PATH:
export JAVA_HOME=/usr/java/jdk1.8.0_111
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
export PATH
restart your VM
check Java version - should be the 1.8 one now:
[cloudera#quickstart ~]$ java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
By the way, I did not setup the /usr/java/default with the 'latest' sym link as #milk3422 did, for the sake of simplicity, but it would have worked just as well.
thanks!
I hate to answer my own questions, but here is the answer:
The wrong version of $JAVA_HOME is getting set for 2 reasons:
Using the command service removes most environmental variables. From man service:
service runs a System V init script in as predictable environment as
possible, removing most environment variables and with current work-
ing directory set to /.
The /usr/lib/bigtop-utils/bigtop-detect-javahome script has the ability to be configured with the environment variable BIGTOP_JAVA_MAJOR to manually set which version of Java to use. I tried setting this as an environment variable, but service removes it :(. It is also important to note that this script will find all versions of java installed, but the order of preference is Java 6, Java 7, Java 8, Open Java. So if you have Java 6, and 8 installed, it will prefer 6 over 8.
In short, to fix my problem, I added the following to the top of /usr/lib/bigtop-utils/bigtop-detect-javahome:
BIGTOP_JAVA_MAJOR=8
You can also set JAVA_HOME in this file to specify a specific version or path.
I had the same problem. I set
JAVA_HOME=... below the file /usr/lib/bigtop-utils/bigtop-detect-javahome
to override the default detect value. That works great!
Java is configurable in the web UI. Open Cloudera Manger --> Hosts --> Configurations --> Advanced, then set the JAVA HOME. This overrides the CDH's Java detection mechanism.
This may seem trivial but I haven't been able to find a fix.
I've installed the latest Java runtime environment but when I run java -version on the command line, I still get Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
However, when I test my Java version in browser, it works fine.
How can I get Terminal using the latest java version?
see Installed Java 7 on Mac OS X but Terminal is still using version 6
maybe you need to select the java version you want to see.
I am assuming you are using windows..
from your command line
echo %PATH%
make sure your java PATH is pointing your latest java bin folder.
I am not sure about the Mac but Can you verify if you have symlink setup under /usr/bin?
ex. /usr/bin/java -> java_path
Maybe you can change this symlink to point to the latest java you have installed.
Hi everybody.
The problem: elcipse-3.5.0 (Galileo) spits with an error when I try to launch it by clicking its launcher. The curse sound like this:
A Java Runtime Environment (JRE) or
Java Development Kit (JDK) must be
available in order to run Eclipse. No
Java virtual machine was found after
searching the following locations:
/home/emanemos/bin/eclipses/eclipse-3.5.0/jre/bin/java
java in your current PATH
However, everything goes smoothly when eclipse is started from console.
Before installing eclipse I've installed jdk1.6.0_16. I also created the $JAVA_HOME variable and changed my $PATH:
$ echo $JAVA_HOME
/usr/lib/java/jdk1.6.0_16
$ echo $PATH
/home/emanemos/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/java/jdk1.6.0_16/jre/bin
So that, my terminal got to know what java is:
$ java -version java version
"1.6.0_16" Java(TM) SE Runtime
Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build
14.2-b01, mixed mode, sharing)
Then a folder eclipse was extracted from .tar.gz package under the directory ~/bin/eclipses. I changed the folder's name eclipse to eclipse-3.5.0 and changed $PATH again:
$ echo $PATH
/home/emanemos/bin/eclipses/eclipse-3.5.0:/home/emanemos/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/java/jdk1.6.0_16/jre/bin
From this moment I was blessed to launch eclipse from console by the command eclipse.
However, I feel desperate about using the eclipse's application launcher.
Thanks in advance. I would be grateful for any help.
The message says "No Java virtual machine was found after searching the following locations: /Applications/eclipse/Eclipse.app/Contents/MacOS/jre/bin/"
I have solved it creating the folder /Applications/eclipse/Eclipse.app/Contents/MacOS/jre/bin and linking to the command at /usr/bin/java:
ln -s /usr/bin/java /Applications/eclipse/Eclipse.app/Contents/MacOS/jre/bin/java
Add this to eclipse.ini:-
-vm
$Java_home/jdk1.5.0_14/bin/javaw.exe
I could be off, but it looks to me that you don't have JAVA in your path. If you notice, you had to add it via the echo command. However, that only stays for that session of the terminal. You don't permanently affect the system. (I believe that's why you can launch from the terminal, but not via the launcher.)
Do you have the Java JRE actually installed on your system? If not, I would recommend doing that as that should do all the setup that you would need, then try running Eclipse again.
Edit: I noticed you said that you did install the 1.6 JDK. This should have fixed your problem. If Java is not in your path when you first open up your terminal, then that (I believe) is your real problem and you may need to do a reinstall or troubleshoot there.
(Making a big assumption that you're on Linux using X)
If you've installed the Java JRE without logging out and back in to the X session, the environment the session is in won't contain the $JAVA_HOME variable. It may just be a case of logging out and back in in order to get a new X session.
If you want to keep the same session running, you could try it out by pressing Ctrl+Alt+F9 to start another GUI session.
Fazil Baghirzade i solve the this problem
A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations:
c:\Program Files\Eclipse\jre\bin\javaw.exe 'javaw.exe' in your current path
go to the "C:\Program Files\Java\jdk1.6.0_39" in this folder have "jre" folder copy it and paste the eclipse folder
thats all!!!