jdk version 8 silent install doesn't update path environment variable - java

I am installing JDK 8 171 on windows 2016 server core using Ansible. When I install using the GUI, it updates my path on my workstation. But when I do it silently it does not. I will have to make Ansible update the path or the batch files if it won't, but that means changing the code for every new version of Java. I wanted to use JRE, but that fails to install at all on core 2016 with Ansible, it tries to update JavaWS reg settings for browsers and as there are no browsers, fails and rolls back. I've extracted the MSI and run a jdkxxxx.msi /? and see no parameters to tell it to update the path. Just wondered if anyone else had run into this, been trying different combinations for two days now and pretty much hit a wall with this now.

Related

How do I install an earlier version of Java for testing Windows app?

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.

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.

Turning Off Auto Update on JDK installation of Java 8

Does anyone know how to turn off the Auto Update feature of Java 8 when installed as a JDK?
We use puppet to install java 8 JDK on hundreds of TeamCity windows agents. The silent installation works fine but the default is to turn on Java Auto Update. Then sometimes the Java update process hangs waiting on someone to reply to the auto update prompt. How can we turn off auto update for JDK installations.
I've seen that this can be done with a configuration file at installation for JRE installation but I can't find anywhere on how to set that up for JDK installations.
The only thing I can think of is to disable the auto updater that loads on startup. This applies to most versions of Windows:
enter code here
- Start menu
- type in my config and hit the first option
- navigate to the start up programs tab and find something along the lines of "java auto updater" and select it and press the disable button.
Another way of doing it is by using CCleaner: it has a built in option to disable startup programs + it is very useful for cleaning the registry and junk files.
If you want to leave out the updater you can take a different approach: download the server JRE provided by Oracle. Despite its name it contains a JDK. The only downside for you might be that this JDK is only available as x64 because it is Oracles policy to only provide this version on servers.
Here is the content of the .tar.gz, which can be unpacked using 7-zip for example. You can clearly see that there is a javac.exe inside that archive:

How do I install Pentaho BI CE on windows?

I'm sure this has a relatively simple answer -_- , but I keep getting a ton of errors and I have no idea why.
Here is the guide I am following:
http://akbarahmed.com/2012/05/12/install-pentaho-bi-server-4-5-on-windows-7-x64/
I am using Java 1.8.0.05, and biserver-ce-5.0.1-stable
When I run start-pentaho.bat, and the Tomcat window opens, I get a whole host of errors.
If I go to localhost:8080/pentaho, I get the following errors:
One or more system listeners failed. These are set in the systemListeners.xml.
org.pentaho.platform.api.engine.PentahoSystemException: PentahoSystem.ERROR_0014 -
Error while trying to execute startup sequence for
org.pentaho.platform.repository2.unified.BackingRepositoryLifecycleManagerSystemListener
I have gone through this entire process 3 times, but nothing seems to work.
There are 3 things you have to take care of:
When running on windows, it is easy to run into Windows' path-length limitation. This then will break the jar-loading which in return gives you random errors as the Tomcat server cannot find the classes contained in these jars. So when you install, do not install it deep into a directory, keep it at the root of your disk. From hard experience, I now always install it in DRIVE:\Pentaho
The Server will not run without the system database. If your logs show you a Quartz-Error, or a Hibernate error, then your HSQL database is not running. In the download, you'll find a "data" directory. Start the "start-hypersonic.bat" before you start the main Pentaho server.
Pentaho does not run with Java 8. There seem to be some incompatible changes in the JDK and I have not been able to actually start it up correctly. You have to use JDK 1.7 to be successful. ALso make sure that your JAVA_HOME or PENTAHO_JAVA_HOME points to the correct JDK.
The Pentaho bat files try to locate a Java installation automatically, and without explicitly setting these environment variables, any JDK may be picked up at random. Usually that is the last JDK that has been installed or updated. So to be safe, lock down the JDK by setting these variables (via Control Panel-> System -> Advanced System Settings -> Environment Variables)
You need to check the catalina.out and pentaho.log files (both should be at biserver-ce/tomcat/logs).
They'll give you more detail on why the server is not starting.
I was having the same error when I installed Java 8 and even after I reinstall Java 7 without removing Java 8 completely.
Remove all Java installations, then you install Java SDK 7
Set the environment variable PENTAHO_JAVA_HOME as your Java 7 path
Then you reboot your computer
Then you start Pentaho BI Server
Hope this help you.
BTW, don't use IE or Safari.

Tomcat 7 startup error: tcnative.dll is not valid

I use;
Windows 7 64 bit,
JAVA_HOME= JDK1.7 64 bit,
Tomcat-7 64 bit version
When I start tomcat from commandline it works ok, but when I use it within IntelliJ I get this error;
java.lang.UnsatisfiedLinkError: tcnative-1 (.\tcnative-1.dll is not a valid Win32 application.
I also point to an IBM 32bit JDK1.6 from IntelliJ in project settings, but this could not be a problem since this setup works on some other collegae's computers
I have read similar questions here, but none of them offers a solution for my case, any ideas, how can I fix this?
Here is a link which describes the problem :
Cause:
You get this message when you start Tomcat. Tomcat is looking for a shared object call tcnative (dll or so depending on the platform). If it doesn't find it, it'll revert to java libs. Either way, this shouldn't affect your application. tcnative dll is needed to address scalability in Tomcat.
Solution:
Turn down debugging level for Tomcat or
Get tcnative from http://tomcat.apache.org/native-doc/ (windows users can download the binary) and place it in your library path.
Lib path is usually: C:\Program Files\Apache Software Foundation{Apache Tomcat directory}\lib; for windows
Basically It seems that you may have an incorrect version.
Are you using multiple java on your machines if yes then try to look into environment variables for JAVA_HOME & PATH. Secondly, also paste the complete version of java and tomcat
Also run following commands at command prompt
java -version
javac -version
echo %JAVA_HOME%
And are you using MSI installer of tomcat or just a zip version of tomcat. Because in many cases MSI installer never work for some ghost reasons.

Categories