What's the use of the deployment.properties file when you install Java?
Answers (1)
Top Answer
There is plenty of information regarding all the different options for deploying Java out there, I used to find myself very confused by it all too, as I wasn't sure which one to follow, I ended up compiling my own deployment package by following the guides found on the Java docs @ oracle.com, some links provided at the end of my comment.
The deployment.properties file is used to store and retrieve deployment configuration properties that can be seen in the Java Control Panel. It can also be used for customizing the runtime behavior for the Java Plug-in and Java Web Start.
The location which you are referring to (C:\Users\%user%AppData\LocalLow\Sun\Java\Deployment\) is used for a User-level configuration, and I believe this is non-configurable.
What I believe you need to look at is at the "System-level" configuration. For this, you first need to configure another file called "deployment.config", inside this file you can define the location of the system-level deployment.properties file.
This is what my current Java deployment configuration looks like, I have been using this for over a year now and have had to make very minor changes:
1. Create a folder called "config" and inside create 3 differente files:
- deployment.config - The contents of this file:
deployment.system.config.mandatory=true
deployment.system.config=file:///C:/WINDOWS/Sun/Java/Deployment/deployment.properties
- deployment.properties - The contents of this file
# System Deployment Properties
# Created by David Zapata
# Updated on 28 November 2016
# Disable Sponsor offers like ASK Toolbar
install.disable.sponsor.offers=true
install.disable.sponsor.offers.locked
# Mixed code (sandbox vs. trusted) security verification
deployment.security.mixcode=HIDE_RUN
# Security Level
deployment.security.level=HIGH
# Security Execution Environment\Enable granting elevated access to signed apps
# aka. Allow user to grant permissions to signed content
deployment.security.askgrantdialog.show=true
# Enable Java content in the browser
deployment.webjava.enabled=true
# JNLP File/MIME Association
deployment.javaws.associations=0
deployment.javaws.autodownload=NEVER
deployment.javaws.autodownload.locked
# Shortcut Creation
deployment.javaws.shortcut=NEVER
# Prompt: Your Java version is insecure. or Your Java version is out of date
deployment.expiration.check.enabled=false
deployment.expiration.check.enabled.locked
# Exception sites file location
deployment.user.security.exception.sites=C:\\WINDOWS\\Sun\\Java\\Deployment\\exception.sites
# Java Console - Options for show, disable or hide the Java Console
deployment.console.startup.mode=HIDE
- exception.sites - You can add application URLS in this file to allow your users to Java enabled sites that would normally be blocked by security checks. Note that once you use this file, sites can no longer be added in the Java Control Panel, this gives you more control as you can manage this exclusively through the exception.sites file.
This is what my Config folder looks like:
2. Create another folder, you can call it Jre1.80_xx (I use whatever version of Java I'm deploying to keep some standard and also make it easy to identify. Inside this folder, place the config folder as well as the latest java exe available (at time of writing it is jre-8u131-windows-i586.exe). You are also going to create two more files inside this folder:
- java.settings.cfg - The contents of this file can vary, depending on your deployment needs, this are my settings:
INSTALL_SILENT=1
STATIC=0
AUTO_UPDATE=0
WEB_JAVA=Enable
WEB_JAVA_SECURITY_LEVEL=H
WEB_ANALYTICS=0
EULA=0
REBOOT=0
NOSTARTMENU=1
SPONSORS=0
REMOVEOUTOFDATEJRES=1
- install.bat - This is your install script pulling everything together
@echo off
setlocal enableextensions
@cd /d "%~dp0"
REM The below command will look for and uninstall any previous Java 7 or 8 from the target machine
wmic product where "name like 'Java 7%%' or name like 'Java 8%%'" call uninstall /nointeractive
REM The first command will copy the Java configuration file to the target machine
xcopy java.settings.cfg "C:\ProgramData\Oracle\Java\" /I /Q /R /Y > nul
REM The following line will install the java software to the target computer
Start /wait jre-8u131-windows-i586.exe /L C:\Drivers\jre-8u131.log
REM The next line will copy the Java deployment property files to the target computer
xcopy Config\*.* "C:\Windows\Sun\Java\Deployment\" /I /Q /R /Y > nul
endlocal
NOTE: The way I use my batch script allows me to either deploy my software package from the K1000 by calling install.bat, or I can do a manual install on the target computer by simply right clicking on the batch file and run as admin, as long as all the contents stay inside the same folder the installation will work. I use this for all my software packaging actually, helps me to easily do manual installs on target machines where the agent may not be installed, or when users download the software package from the user portal, I instruct them to install the software by right clickin on the install.bat file.
This is what my software package looks like before I zip it and upload to my KBOX
Again, this has worked really well for me for about a year now and have had to make very little changes, you may need to make some customizations of your own, but I believe this should at least give you a guide.
More info regarding the deployment.properties file
https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/properties.html
More info regarding the Java configuration file
https://docs.oracle.com/javase/8/docs/technotes/guides/install/config.html
Hope it helps.
Comments:
-
Pretty much followed this template for our most recent Java 8 Update 144 SCCM deployment. Has worked very well, so thanks for this post. - Vialli 7 years ago
-
We do not have folder name C:\Windows\Sun\Java\Deployment. have you make this folder? next question is about content of deployment.properties file, can we copy user based deployment.properties file and add only following line deployment.user.security.exception.sites - Faisal79 5 years ago