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.
Related
I'm using NetBeans to develop a Windows app that needs to send email. It works when run from Netbeans(NB), but not outside. Specifically, running the created .jar fails to connect. I think the is the default NB Java version is jdk1.8.0_131 (presumably because that was the current JDK when I originally installed NB and began my app development), while Windows C:\Program Files\Java shows jdk1.8.0_131 and jre1.8.0_291. To test this, I'd like to run my NB created .jar file using jre1.8.0_131.
The selected answer to execute JAR file using a specific version of the JRE says I have to download and install "download and install older version." I've mad several attempts to do the latter, but have yet to find the exact download among the myriad of items at Oracle's site. I'm running Windows 10 Pro.
Any guidance gratefully accepted.
Due to a change of Oracle's licences, you can't download older versions of Oracle's java without an Oracle account.
That being said, you probably want to take a look at OpenJDK or AdoptOpenJDK for older java versions.
I got NetBeans 12.4 running on JDK 8 update 131 on Windows 10 as follows:
First note that there are issues with the use of Firefox for this process, so use a non-Mozilla browser such as Chrome or Edge.
Update 131 is a very old release, and (I think) is only available from Oracle via their Java downloads. You will need an Oracle Account (rather than a Cloud Account) to download, so create one now if necessary. Otherwise log in to your Oracle Account by clicking the View Accounts button at the top of the page.
Oracle's installer gets upset and confused if you have some higher update of JDK 8 already installed, so the first thing I did was to remove it through Control Panel > Programs > Uninstall a program. Optionally delete any remaining JDK installation files from disk as well, though that is not essential.
Go to Oracle's web page for downloading old updates of JDK 8 and JRE 8: It's a very long web page titled "Java SE 8 Archive Downloads (JDK 8u202 and earlier)".
To save scrolling, search in the browser for the text "131". You should land exactly where you need to be within the page, on a line titled "Java SE Development Kit 8u131". Scroll down just a few lines to the line for your hardware and O/S combination. In my case this was "Windows x64".
Click the link for the download file specified to the right on that line. In my case it was named jdk-8u131-windows-x64.exe. The browser should download the file, although if you haven't yet logged in to your Oracle account you will be prompted to do so. As long as your credentials are valid the download will still work.
Since you are using Windows, in File Explorer locate the downloaded file in your browser's download folder. In my case the size of the downloaded file was 207,649,848 bytes.
Double click the file to execute it, and run the JDK installer. By default the installer will install the JDK to one of the Program Files directories on Windows, but you can specify an alternative directory if you prefer. If all goes well the install of update 131 of JDK 8 should work, and you will see this screen:
Next, in NetBeans 12.4 open Tools > Java Platforms and click the Add Platform... button to add JDK 8 update 131. It should be shown as a new platform, though not the default one:
At this point, if you don't want or need JDK 8 update 131 to be your default platform (meaning it is the platform that NetBeans itself runs on), you are finished. Otherwise, follow the remaining four steps below.
Next, edit netbeans.conf to make JDK 8 update 131 the default platform. Add a line similar to the one below, but specifying your appropriate path:
netbeans_jdkhome="C:/Java/jdk1.8.0_131"
If there are any other lines in the file starting with netbeans_jdkhome comment them out with a leading #.
Save the file and restart NetBeans.
From Help > About you should see that JDK 8 update 131 is now the default platform:
To start with :
Using any of the older releases form archive is a potential security
risk.
The specific root cause of the real problem 'works with IDE not with jar' may not necessarily be with the major/minor version itself
But since the question you have posted is about how to install older version, my answer would be:
You should first confirm the specific version of Java SE you need. If it's an older version, that should probably be Java 6, Java 7 or Java 8. If you have already faced an issue, you logs would generally show errors pertaining to a version. If yes, cross check with this link for details.
Go to this Java Archive link.
Good to Sign-in at this point or create an account
You will find sections for Java SE, Java EE, Java ME and Java FX. The default Java SE is the one you probably need
Click on the link for the specific version e.g. Java SE 8
That page will show you a list of sections ordered in this form
Ordered by latest update release number
Type (JDK, JRE or Server JRE)
Select the latest on the top with section name starting Java SE Development Kit. E.g. for Java SE 8 search for 'Java SE Development Kit 8u'
In this section select the download for the specific OS version. E.g. Windows x64
Find JDK installation path :
On windows, if you have installed too many JRE/JDK installations and you are unware of the location :
Click Windows key + X, then I
Copy paste text : Get-Childitem –Path C:\ -Include javac.exe -Filter javac.exe -File -Recurse -ErrorAction SilentlyContinue
Using judgement or even date, note the directory that contains the version number you have installed
Make changes how your application runs :
Option 1 :
Right click My computer -> Properties -> Advanced System Properties -> Advanced -> Environment Variables
Below variables to be modified similar to :
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_xxx
JDK_HOME=C:\Program Files\Java\jdk1.8.0_xxx
Append a %JAVA_HOME%\bin to the PATH variable as well
Run
Option 2 :
Install older version of the JDK on a separate machine and copy the folder onto your new hosted machine.
If you jar name is ed.jar and Main class is com.ed.Main then use direct call similar to below :
C:\Program Files\Java\jdk1.8.0_131\bin\javaw -cp ed.jar com.ed.Main
OR C:\Program Files\Java\jdk1.8.0_131\bin\javaw -jar ed.jar
You can't if you never installed Java 7 or if you don't have an Oracle account.
Oracle said that here.
Java 11 had recently arrived and, as everybody knows, this version has no installation file.
To install Java without installer I, of course, had set my system settings PATH and JAVA HOME to the address of the folder where my Java 11 was unzipped (advised by accepted reponses to similar questions).
The only thing is that all those advices about system settings make no effect whatsoever on my machine:
Checking with a command line outputs my old Java 9 version
With Java 9 removed from the folder, command line does not recognise any Java at all.
So, is there actually any way to install this version?
Thanks for future answers and for not marking my question as a duplicate (for the reason explained above)
The problem resided in the format of the path line:
My path included multiple entries, I was putting Java at the end of the line and the change was not working
But when I placed it right at the start of the path line, Java 11 got accepted and started to function alright on my Windows.
For other users facing a similar issue:
The root of the problem was that, as Klitos Kyriacou rightly pointed out, my path included other entries that had a word 'java' in their names. When placed before Java 11 in the classpath, those entries were invalidating my adding of the java version.
Looks like Oracle uninstaller does not clean up everything.
Even after uninstalling all old jdk/jre and installing OracleJDK 11, my system still has "C:\ProgramData\Oracle\Java\javapath" folder and "C:\ProgramData\Oracle\Java\javapath" entry in PATH.
Because of that when I run "java -version" I get:
C:\>java -version
Error: opening registry key 'Software\JavaSoft\JRE'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
Due to this issue, at the moment Cordova isn't able to run on Java 9 (please correct me if I'm wrong).
A similar question was discussed here, but the proposed solutions involve the removal of Java 9, or the reset of the JAVA_HOME environment variable to point to Java 8, but both has the side effect that all the other Java applications will run on Java 8.
So how do you set Cordova to use Java 8, having the rest of applications still on Java 9?
... the reset of the JAVA_HOME environment variable to point to Java 8, but [that] has the side effect that all the other Java applications will run on Java 8.
Only if you do it the wrong way!
Create a file (say mycordova.sh) containing this, make it executable and put it on your shell's command search path.
#!/bin/sh
export JAVA_HOME=/path/to/java8/home
cordova "$#"
Running that command runs cordova using Java 8 without interfering with other applications.
UPDATE - If the work-around proposed is to use alternatives to change, that means that the cordova launcher / script, is not using JAVA_HOME to find the java command. You can deal with that too. There are a couple of possibilities:
If cordova is a wrapper script, then copy it and edit it to use the version of the java command (etc) that you want to use.
If not then in your mycordova.sh script (see above) also update the PATH variable so that the Java 8 JRE's bin directory is ahead of the directory containing the java link that alternatives manages. That will work ... provided that the standard cordova launcher has not hard wired /usr/bin/java
UPDATE 2 - Final script for mycordova.sh is:
#!/bin/sh
export JAVA_HOME=/path/to/java8/home
export PATH=/path/to/java8/bin/:$PATH
cordova "$#"
I built my NetBeans web project with Java 1.5 successfully, however; my linux server supports / uses Java 1.4 and Java 1.5 (as well as JBoss 4.0.2).
When I check the version of my project ( java -version ) it says that the current version is Java 1.4.2. However, I don't want to change the "JAVA_HOME" setting on the server because other projects need to use this version.
I want my project to use Java 1.5 from the server...
An idea as to how I should go about doing this? Is there a configuration that I can change?
I have this error:
java.lang.UnsoupportedClassVersionError: bad Version in .class file
You need Java 1.5 version installed in your Linux server.
Next, run the following set of commands in your terminal/command prompt:
JAVA_HOME="{fix-me}"
export JAVA_HOME
export PATH = $JAVA_HOME/bin:$PATH
In the place holder {fix-me} specify the path of Java 5 that is installed in the Linux machine.
This would only temporarily set the Java version to 5 until the terminal/command prompt session is alive. So you need not worry about disturbing other projects.
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 .