Good morning, I have an application that works only with Java OpenJDK 64-Bit Server VM 1.8.0_292, however we are in the Java OpenJDK 64-Bit Server VM 1.8.0_312 version. How can I install it?
Go here: https://adoptium.net/releases.html?variant=openjdk8
download package
extract package
try calling it direclty (/new/path/jdk8/bin/java -version). This should now differ from calling the default java (java -version)
instead of calling the first java the systems finds (like java -Xmx500G -jar yourApp.jar), run your app via direct java path call: /new/path/jdk8/bin/java -Xmx500G -jar yourApp.jar
For Windows you can create .bat files, for linux you can create runnable bash scripts etc.
Oh, and a little side note: if that app is really only running under a certain revision version of java, it's probably really bad software...
Related
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 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.
I'm setting up an Ubuntu VM to experiment with Clojure. In the Getting Started guide for Clojure, it shows running a java command. which java in my vm doesn't find anything.
I know nothing about Java. Tutorials for installing Java talk about the runtime environment, the SDK, etc.
What do I actually need in order to run Clojure?
Just the Runtime Environment
To run the REPL, all I needed was the Java Runtime Environment, which I installed with sudo apt-get install openjdk-7-jre.
On my Red Hat server, java -version outputs;
$ java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
$
However, neither PATH, nor JAVA_HOME environment variables are set. Likewise, JAVA_HOME is not set on ~/.bash* files.
Why and how my server uses this version of Java while two other versions of Java are installed as well?
Firstly, JAVA_HOME is not involved in this. (JAVA_HOME is used conventionally by wrapper scripts, etc for applications that use Java ... but not by any of the Java executables themselves.)
Second, you are probably running java via a symlink managed by the alternatives program. (RHEL and similar distros use this utility to allow you to select different versions of utilities installed on the same system.)
Either way, running the following will help you figure out what is going on.
$ ls -l `which java`
(Then following the chain of symlinks until you get to the actual executable.)
Which executable runs depends on PATH variable. Double check it. It can't run if not set it is impossible unless you have some strange Linux config.
If Java executable is in current directory, it would run by ./java. Since it runs with just java it is somewhere in the PATH.
For a script I am making, I need a cross-platform way to check:
If java is installed.
What platform the script is running on (eg windows/amd64 or linux/x86)
in python. How could I do both of these.
Edit: The platform module is perfect for number 2, but a way to see just if java is installed not the version would be preferred.
is a duplicate of How to determine whether java is installed on a system through python? for which I agree with the second answer, in particular, that you shouldn't check most likely. You should document your dependency on it, and have your package manager on whatever systems have one install it, and on Windows have your user install it themselves.
The platform module.
for checking if java is installed you can use
def run_command(command):
p = subprocess.Popen(command,
stdout = subprocess.PIPE,
stderr = subprocess.STDOUT)
return iter(p.stdout.readline, b'')
out = list(run_command("java -version"))
from vartec at Running shell command and capturing the output
I would suggest to simply try and run java -version.
A proper installation of java will add it to the path on both Linux and windows (so the java command line can be executed from "anywhere" on the file system).
For example - here is the result when I run
java -version
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)