Java Runtime different versions on windows - java

I have installed 2 different versions of Java on my Windows 7 64-bit. One version 6 and another version 7.
One app that i run from http, seems using version 7, though i want it to be version 6.
How can I change the path to use version 6? Please note i am technical but not on oracle..so maybe a step by step could be useful.

Change you JAVA_HOME to 7 version also you need to update the Path variable if it is hard coded like c:\Program Files\java\bin .

Related

Is java -version telling me about the JRE or the JDK?

I had only a JRE and now I also downloaded a JDK; they are listed in control panel as:
Java 8 update 121, Java SE Development Kit 8 Update 121
so I guess the JRE inside my JDK and the other JRE are the same version;
When I write in cmd java -version; is it the original jre or the jre inside the jdk's folder?
Also i was thinking, considering i have 2 identical JRE, can i delete the old one or is it bad practice?
It relates to whatever's first on your path, simple as that. Every executable follows the same resolution rules.
On unix, you can use this to see where it's coming from
which java
On Windows it's
where java
java -version tells the JDK version and yes, you should only keep the latest production version of JRE and JDK in the system. No need for having multiple libraries as any application can have only one JRE associated with it.

Error:" Unable to find any JVMs matching version "1.8"."

When I run flutter create x or flutter doctor I get the following message
"Unable to find any JVMs matching version 1.8.
I also tried following another thread on StackOverFlow for this issue but it did not help because it did not specify what to do if you already have java installed. At the moment when I run java-version I get the following message:
java version 13.0.1 2019-10-15
Java(TM) SE Runtime Environment (build 13.0.1+9)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
Thank you in advance for the help!
EDIT: I found a solution!
echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)" >> ~/.bash_profile
All I did was replace 1.7 with a JDK I already had installed and now it works. The thread can be found below:
How to set JAVA_HOME environment variable on Mac OS X 10.9?
You've installed java 13 while your application is looking for java 8. So install java 8 and set it your default jvm/jre (set your JAVA_HOME).
Hope it helps !
Just a guess, as I do not use Flutter…
Java changed its version numbering scheme
Java changed the way it reports its own version number. In earlier versions, the number was always 1.x.y where x is what we colloquially considered to be the version. Eventually Sun/Oracle decided to make that common usage official. So now later versions such as the one you are using dropped the 1.. Rather than 1.13.y Java now identifies itself as 13.y.
Update Flutter
This change in version numbering scheme can confuse old software that expected the version number to always report 1.x.y. Such software needs to be updated to understand the new number scheme.
I suggest you update your Flutter library to a more recent updated version, if one exists.
Downgrade Java
Most Java 8 apps should run without a problem on Java 13 if it weren't for this tiny version number interpretation issue. So you should not have to downgrade from Java 13 to Java 8 to run your app. But you might need to downgrade to resolve this issue if Flutter was never updated properly.
If you do need to downgrade, here is a flowchart I made to help locate a vendor of a Java implementation. This chart is aimed at Java 11, but most of these venders provide Java 8 implementations as well.

Cannot start jmeter 3.3 with java 9

For some reason, there is installed Java 8 and Java 9 on my computer with Win10Pro.
How to run JMeter?
As I found some info, there are two ways:
1) run last official JMeter 3.3 with Java 8 using system variable settings:
-- I set up sys.variables in windows system setup targeting to my Java 8 folder:
JAVA_HOME = C:\Program Files (x86)\Java\jre1.8.0_45\bin
-- and run jmeter.bat.
Result: JMeter was still starting in java9.
"Error: Java version -- 9.0.1 -- is too low to run JMeter. Needs a Java version greater than or equal to 1.8.0 errorlevel=3"
2) to download last night build java9 compatible apache-JMeter-r1822461:
-- I set up system variable targeting to java9:
C:\Program Files\Java\jdk-9.0.1\bin
--I run the jmeter.bat:
Result:
nothing happened - just blink the cmd window and closed.
WHere the problem is, what to do?
thanks,
Martin
Here's a message straight from their website:
JMeter does not yet support JAVA 9, next JMeter version will support it, you can help and follow progress on this item in Bug 61529.
Since you already have Java 8 installed on your machine, just run it with that. Assuming jmeter.bat runs a .jar file, you can use the following as an example:
"C:\Program Files (x86)\Java\jre1.8.0_45\bin\java.exe" -jar jmeter.jar
If you want to use the .bat file, you'll have to change your environmental variables (PATH) to reflect Java 8: Environment variables for java installation
Edit 29 january 2018:
Note Java 9 will be supported in 4.0 which should be released in upcoming days.
You have at least 3 options:
Uninstall Java 9
Click Win + R
Type appwiz.cpl
Find everything which contains Java 9 and uninstall it
Amend your PATH environment variable so Java 8 executable comes first like:
set PATH=c:\path\to\java8\bin;$PATH%
You can insert the above line directly into jmeter.bat file or run it in a terminal prior to starting JMeter
Use one of the nightly builds, there is a chance the issue is resolved already
More information: How to Get Started With JMeter: Part 1 - Installation & Test Plans
You can use JMeter 4 with which we don't see this issue anymore.
Otherwise, there's a fast but ugly way: comment the version check bloc in the launcher script(jmeter.sh, .bat) or specify the JDK in this launcher. Then it works with JDK 9 and 10.

Sun Java 6 on Ubuntu

The java library I need (jpcap) only works on Java 6, it won't work with Java 7. Is it still possible to install Java 6 on Ubuntu? According to the Ubuntu Help:
Oracle (Sun) Java 6 is no longer available to be distributed by Ubuntu, because of license issues
I've tried to use the instructions on the same site but they don't seem to work...
./jre-6u34-linux-i586.bin doesn't seem to do anything!
Check out these instructions on how to install Sun JDK 6. In older versions of the repositories the desired package is included.
If you're not obliged to, try using jNetPcap instead. It's another wrapper around pcap, it just works on more recent JVMs and is not restricted to 32 bit architecture.
I would try the OpenJDK 6 which AFAIK is fine on Ubuntu and check you have the right version 32-bit vs 64-bit for your machine. i586 is 32-bit and won't work with a 64-bit build of jpcap.

Mint Linux - Downgrade Java to 1.5

Currently, I am running Mint Linux (Release 9). I need to downgrade Java from version 1.6 to 1.5, and have been trying to figure out how to go about this. So far, I've had no luck. The package manager doesn't seem to have it.
Does anyone have any suggestions?
Thanks,
- Chris
As you explained in your comments, you need JDK 5 because you are working on the source code of Android itself and the instructions say:
Ubuntu Linux (64-bit x86)
... JDK 5.0, update 12 or higher.Java 6 is not supported, because of incompatibilities with #Override.
You can do this:
Uninstall any Java that you got via the package system of your Linux distro
Download JDK 5 Update 22 for Linux
Run the JDK installer with sudo, install it wherever you like (for example in /opt or /usr/local)
Set your PATH environment variable to include the bin directory of the JDK
There should be no need to downgrade your Java installation to develop for Java 1.5. If you are using a tool such as Eclipse, you can set the project attributes so that it tests for Java 1.5 compatibility, and gives errors if you use a Java 6 feature. If you absolutely insist on having a Java 1.5 JDK then just install it alongside the default installation and use it in place of Java 1.6.
This should be a question for SuperUser.com, but my recommendation is to download the 1.5 JDK, and change Java path to where you downloaded it.
Or you could use the info on Ubuntu Help, it should work for you since Mint is based on Ubuntu. That link explains how to select the version of Java.

Categories