Weblogic10.3.5 install: Unrecognized option: -d64 - java

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

Related

Java appears to be outdated when using java -jar command

I have recently been writing some Java programs on my Windows computer. I have been trying to use java -jar to run compiled jars in order to see errors more clearly, but when I try to do this, I get the following error:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/company/app/GUI has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0
This obviously means that my java version is outdated. However, when I took a look at the Java Updater, it shows that I am running the latest version.
Running java -version shows this:
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) Client VM (build 25.261-b12, mixed mode)
So why is Command Prompt using an older version, and how do I change it?
Thank you for your help.
This error clearly indicates that you try to run a .jar file built with JDK 13 (major version 57) on a JRE/JDK 8 (major version 52) which is provided in PATH setting and thus invoked when running java -jar / java -version commands.
If you have JDK 13 installed on your machine, you need to check environment variable PATH and/or JAVA_HOME:
C:\Users\hp1>echo %JAVA_HOME%
C:\Java\jdk-13.0.2
C:\Users\hp1>echo %PATH%
C:\Windows\system32;C:\Java\jdk-13.0.2\bin
C:\Users\hp1>java -version
openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
If PATH refers JRE/JDK 8, you may create another variable and update PATH (copy non-java paths):
>set JAVA_13=**path_to_your_jdk_13**
>set PATH=C:\Windows\system32;%JAVA_13%\bin
If you do not have JDK 13 on your machine, to resolve this issue you should rebuild the .jar file to make it compatible with JDK 8 providing that the code is not using any features from the newer versions.

Can't run java applications

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.

installation error for elasticsearch on windows7

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/

Error: Could not find or load main class version

I have downloaded Java on mac mavericks system. But when I type on terminal to see the Java version using command:
java version
I get the following error
Could not find or load main class version
I went to oracle website and tried a check to see if Java is installed on my system,which confirmed the Java7 is installed on the system. But why can I not see version in terminal?
Try
java -version
Without the minus sign it is trying to load a program called version.
java –version
will cause the same error (copied from webpage) as "–" is an em dash
java -version is the command to check java version
Download latest Java SE from Oracle site and install it. Then reopen cmd and check java version using java -version.
Set the Java path to bin and check it's version also. Both java and javac should be on same version.
In my case:
C:\Users\darshan>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
C:\Users\darshan>javac -version
javac 1.8.0_121

Cygwin runs wrong version of java

I have this problem with Cygwin. I have Java 1.6 and 1.7 installed. I want to use maven 3.0.4 with Java 1.7 but I don't want to uninstall Java 1.6. My JAVA_HOME looks like:
C:\Program Files\Java\jdk1.7.0_09
when I run
java -version
in Cygwin I get:
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)
when I run the same command in cmd.exe I get:
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
Does anyone knows how to solve this?
There are two separate questions here.
The first question is why java -version is finding different Java installations on Cygwin and the classical Windows command interpreter.
The answer is most likely that your Cygwin and Windows environments have different values for $PATH and %PATH% respectively. If you want java -version on Cygwin to run Java 7, you need to make sure that the Cygwin $PATH includes the Java 7 bin directory ... in the appropriate syntax.
The second question is how to get the mvn command under Cygwin to use Java 7.
The answer is not so straight-forward:
Setting $PATH might solve your problem.
According to the Maven installation documentation, the mvn wrapper scripts should use the $JAVA_HOME environment variable in your (Cygwin) shell to decide on which Java to use.
The way to find out what is really going on is to look at the wrapper scripts and see what they are actually doing. And if reading the scripts is too hard, try "hacking" the scripts to include set -vx. That will tell you what lines of the script are being read, and what commands are being executed.
Finally, the POM file can influence the source and target levels for your build ... independently of the JVM that runs the build.

Categories