Tracking Down Java Properties

Have you ever read a Java article and the author describes some systems property you never knew existed?  Have you ever wondered what a complete list of systems properties would look like?  Wonder no more. 

Update December 14, 2018 – Didn’t realize until a friend pointed out, there are properties other than System used by the platform like Security for example. This could reduce the number of results returned.

Original Post – I wondered as well so I download one of the later versions of the JDK, OpenJDK 11.   To create a rough list I changed directory to the root of the source I downloaded and grep’ed a rough list of the properties to a text file.

fgrep -R System.getProperty ./* > ~/Desktop/Properties-1.txt

That provides a rough list of property accessors that look like the following.

./make/jdk/src/classes/build/tools/spp/Spp.java:    static final String LNSEP = System.getProperty("line.separator");
./make/jdk/src/classes/build/tools/jigsaw/ModuleSummary.java: System.getProperty("os.name"),
./make/jdk/src/classes/build/tools/jigsaw/ModuleSummary.java: System.getProperty("os.arch"))
./make/jdk/src/classes/build/tools/jigsaw/ListPackages.java: Path javaHome = Paths.get(System.getProperty("java.home"));
./make/jdk/src/classes/build/tools/generatenimbus/Generator.java: File skinFile = new File(System.getProperty("user.dir"));
./make/jdk/src/classes/build/tools/generatenimbus/Generator.java: File buildDir = new File(System.getProperty("user.dir"));

This is a huge list but contains various properties along with code fragments.  To remove the code fragments and pull out the property names I did the following.

awk -F "\"" '{print $2}' ~/Desktop/Properties-1.txt > ~/Desktop/Properties-2.txt

At this point, Properties-2.txt contains a list of properties that looks like the following.

line.separator
os.name
os.arch
java.home
user.dir
user.dir
user.dir
...

This is closer but it’s unsorted and there are many duplicates.  To sort and remove the duplicates I did the following.

sort ~/Desktop/Properties-2.txt | uniq -u > ~/Desktop/Properties-3.txt

All that produces the following list.  A word of warning, there’s still some garbage.  I’m sure some of you can write better expressions me.  With that in mind, here goes.

        System.out.println(System.getProperty(\
System.out.println(\
if ( System.getProperty(\
System.out.println(System.getProperty(\
m = m.concat(System.getProperty(\
String value = (property) ? System.getProperty(name) : System.getenv(name);\n
-cp .
ImplVersionCommand
installed at
on platform
$jj2
%s %s%n
(Ljava/lang/String;)Ljava/lang/String;
) and compile.jdk (
, looked in test.jdk (
-
--check
--class-path
--limit-modules
--module-path
--patch-module=java.naming=
-Djava.library.path=
-Dtest.class.path=
-Dtest.classes=
-Dtest.timeout.factor=
-J-Dnss.lib=
-XX:VMOptionsFile=
-d
-r=
......javaClassPath = System.getProperty('java.class.path');
.KIND
.completers
.filters
0
1. System.getProperty =
15
2
2. System.getProperty =
4. Type \
64
6932525
6959292
<java version=
Arch:
CIPHER
CLIENT_PROTOCOL
CUSTOM_DB_DIR
CUSTOM_P11_CONFIG_NAME
Checking if System.getProperty() returns changed system properies:
ClassFileInstaller: Writing to
Classpath is
ClientJDK=
CompactStringEnabled
CompileTheWorldPreloadClasses
Could not find rt.jar on boot class path %s
Crashes on AArch64 (GR-8351)
DUMP
Dump a11y =
EXPECTED
FailTestIfNothingChecked
GeneratedClassLoader.deleteFiles
HOTSPOT_BUILD_USER=\\\
Hello[EOL]
INFO: user.dir: '%s''\n
InvokeDynamicPrintArgs.allow-untransformed
JarBuilder.DEBUG
Java
Java-http-client/
Java:
Location
META-INF
MS932
MethodHandleConstants.allow-untransformed
NOT DEFINED
NumberOfChecksLimit
OS:
PC/SC
PVTest
ProfileCompiledMethodsPhase.WITH_FREE_SECTIONS
ProfileCompiledMethodsPhase.WITH_INVOKES
ProfileCompiledMethodsPhase.WITH_SECTION_HEADER
SERVER_PROTOCOL
ServerJDK=
String System.getProperty(String key)
String System.getProperty(String key, String def)
SunPKCS11-
System.getProperty() returned unexpected value of changed system property:\n
System.getProperty(|
System.out.println(System.getProperty(\
SystemTraySupport
TEST
TESTTOOLVMOPTS
Test
Test System.getProperty =
Testing on:
Version =
Vis1_A
Vis2_A
Vis3_A
WEIRD_PARAM
XXXX. System.getProperty =
\t
\t -Dtest.src=
\tjava.class.path=
\tjava.class.version=
\tjava.home=
\tos.arch=
\tos.name=
\tos.version=
\tuser.dir=
\tuser.home=
\tuser.name=
activation.host
algorithm2
aot.keep.objFile
appcds.parallel.transform.mode
apple.eawt.quitStrategy
application.home
awt.toolkit
big
browser
cKey
cacheNumPages
cert.dir
certValidity
clz
com.oracle.security.ucrypto.debug
com.sun.management.agent.class
com.sun.management.jdp.address
com.sun.management.jdp.name
com.sun.management.jdp.port
com.sun.management.jdp.source_addr
com.sun.management.jdp.ttl
com.sun.net.httpserver.HttpServerProvider
com.sun.org.apache.xml.internal.security.resource.config
com.sun.tools.jconsole.mbeans.keyPropertyList
compile.jdk
compiler.
compilertest.test262
compilertest.verbose
content.types.temp.file.template
content.types.user.table
country:
delayVerify
dfl:
dir.test.vector.baltimore
do.iterations
dtd_home
encoding:
estLines
eventID
extlink.spec.version
file
foobar
graaltest.timeout.factor
graalunit.libs
http.proxyHost :
http.proxyPort :
https.protocols
https.proxyHost :
https.proxyPort :
https.socksProxyHost
https.socksProxyPort
humongoussize
ignoreJarDirectories
j2ddemo.perf
java.awt.printerjob
java.compiler=
java.iccprofile.path
java.io.tmpdir is
java.lang.System.getProperty(
java.lang.System.getProperty(name)
java.lang.invoke.LoopCombinatorLongSignatureTest.RUN
java.locale.providers
java.naming.factory.initial
java.nio.channels.spi.AsynchronousChannelProvider
java.rmi.server.RMIClassLoaderSpi
java.rmi.server.useDynamicProxies
java.system.class.loader
java.time.zone.DefaultZoneRulesProvider
java.util.PropertyResourceBundle.encoding
java.util.currency.data
java.util.logging.SimpleFormatter.format
java.util.prefs.flushDelay
java.util.prefs.syncInterval
java.util.prefs.systemRoot
java.util.prefs.userRoot
java2d.font.usePlatformFont
javac -d
javac.debug
javac.dump.modifiers
javac.dump.stack
javac.switchratio
javac.trace.depend
javadoc
javadoc full version \
javafx.embed.singleThread
javafx.version
javaplugin.version
javasoft.awtsqe.lw.IGNORE_FOCUS_KVETCH
javawebstart.version
javax.accessibility.assistive_technologies
javax.accessibility.screen_magnifier_present
javax.net.ssl.keyStorePassword
javax.net.ssl.trustStorePassword
javax.rmi.ssl.client.enabledCipherSuites
javax.rmi.ssl.client.enabledProtocols
javax.sql.rowset.RowSetFactory
jconsole.showOutputViewer
jconsole.showUnsupported
jdk.attach.allowAttachSelf
jdk.calendar.japanese.supplemental.era
jdk.internal.javac.source
jdk.jfr.unsupportedvm=
jdk.krb5.rcache.useMD5
jdk.lang.Process.allowAmbiguousCommands
jdk.logger.finder.error
jdk.module.boot.usePerfData
jdk.module.upgrade.path
jdk.nio.maxCachedBufferSize
jdk.system.logger.format
jdk.system.logger.level
jdk.system.module.finder.disableFastPath
jdk.test.lib.artifacts.artifactmanager
jdk.tls.namedGroups
jdk.util.zip.inhibitZip64
jemmy.drivers.installer
jemmy.timeouts.scale
jhat.enableFileMap
jmx-registry.host
jmx.mxbean.multiname
jnuEncoding:
jpda.wait
jsr166.methodFilter
jvmci.Compiler
jvmci.class.path.append
kdc.supported.enctypes
keyStore
keyStorePasswd
keyStoreProvider
keyStoreType
kpass
kuser
lambda.separate.targetDirectory
language:
line.Separator
local
log
logging.properties
mail.host
nashorn.debug
nashorn.persistent.code.cache
nashorn.test.foo
nashorn.test.hello
nashorn.typeInfo.cacheDir
nashorn9
native.kdc.path
native.krb5.libs
nonBatchMode
nopreauth
nss
on
onlyonepreauth
optimistic.override
p1.c1
p2.Vis1_B
p2.Vis1_C
p2.Vis2_B
p2.c2
paddingStr
parserapitest.test262
parserapitest.verbose
parsertest.test262
parsertest.verbose
pass
policy
policy.expandProperties
port.number
port.number1
preloadBidi
primary.suite.cp
principal
provider
proxyHost
proxyPort
recurse
registry.host
requiresCompressedClassSpace
return System.getProperty(\
rmi
rmi.port
rowset.properties
sa.altDebugger
sa.library.path
sccs
security
serialized.data.dir
serverStartupTimeout
showAll
showhint
sizeTolerance
solaris
sparc
stats.timeline.name
sun.awt.X11.XComponentPeer.reparentNotSupported
sun.awt.fontconfig
sun.cpu.isalist
sun.font.fontmanager
sun.hotspot.tools.ctw.logfile
sun.io.allowCriticalErrorMessageBox
sun.java.launcher
sun.java2d.debugfonts
sun.java2d.dpiaware
sun.java2d.font.minstrikes
sun.java2d.font.reftype
sun.java2d.font.scaler
sun.java2d.fontpath
sun.java2d.opengl
sun.java2d.pmoffscreen
sun.java2d.uiScale
sun.java2d.xrender
sun.java2d.xrender.batchGlyphUpload
sun.java2d.xrgradcache
sun.jvm.hotspot.HotSpotTypeDataBase.DEBUG
sun.jvm.hotspot.compiler.ImmutableOopMapSet.DEBUG
sun.jvm.hotspot.debugger.windbg.disableNativeLookup
sun.jvm.hotspot.debugger.windbg.imagePath
sun.jvm.hotspot.debugger.windbg.symbolPath
sun.jvm.hotspot.loadLibrary.DEBUG
sun.jvm.hotspot.oops.ObjectHeap.DEBUG
sun.jvm.hotspot.rmi.port
sun.jvm.hotspot.rmi.serverNamePrefix
sun.jvm.hotspot.rmi.startRegistry
sun.jvm.hotspot.runtime.JavaThread.DEBUG
sun.jvm.hotspot.runtime.VM.disableDerivedPointerTableCheck
sun.jvm.hotspot.runtime.amd64.AMD64Frame.DEBUG
sun.jvm.hotspot.runtime.sparc.SPARCFrame.DEBUG
sun.jvm.hotspot.tools.jcore.ByteCodeRewriter.DEBUG
sun.jvm.hotspot.tools.jcore.NameFilter.pattern
sun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList
sun.jvm.hotspot.tools.jcore.filter
sun.jvm.hotspot.tools.jcore.outputDir
sun.jvm.hotspot.typedb
sun.jvm.hotspot.types.basic.BasicTypeDataBase.DEBUG
sun.jvm.hotspot.utilities.ObjectReader.DEBUG
sun.jvm.hotspot.utilities.soql.SOQLEngine.debug
sun.jvmstat.perfdata.aliasmap
sun.management.compiler
sun.net.ftpClientProvider
sun.net.httpserver.readTimeout
sun.net.httpserver.selCacheTimeout
sun.net.httpserver.writeTimeout
sun.nio.cs.map
sun.rmi.activation.execPolicy
sun.rmi.dgc.logLevel
sun.rmi.loader.logLevel
sun.rmi.log.class
sun.rmi.registry.registryFilter
sun.rmi.server.logLevel
sun.rmi.transport.logLevel
sun.rmi.transport.tcp.logLevel
sun.security.jgss.native
sun.security.mscapi.testprovider
sun.security.nativegss.debug
sun.security.policy.numcaches
sun.security.policy.utf8
sun.timezone.ids.oldmapping
sun.tools.attach.attachTimeout
sun.tools.pack.verify.verbose
sun.util.Vis3_B
swing.defaultlaf
swing.metacitythemedir
swing.metacitythemename
test.5076692.property
test.autoruns
test.class
test.java
test.java.lang.invoke.InvokeGenericTest.verbosity
test.kdc.diff.sname
test.kdc.force.till
test.kdc.save.ccache
test.libs
test.map.collisions.shortrun
test.maptests.dir
test.mode
test.nss.lib.paths
test.patch.path
test.rmi.port
test.runs
test.sandbox.dir
test.security
test.security.protocol
test.service
test.set.null.renew
test.spnego
test.src =
test.terminal.height
test.threadpairs
test.trusted.dir
test.verbose
test/nashorn/script
test/nashorn/script/currently-failing
test/nashorn/script/external/test262/
testID
testLimit
testUnused
thorough
timeout.value
tool
treeView
use.cached.keys
useGsettings
useJavaUtilZip
usenonop
user
user name =
user.country.display
user.country.format
user.dir=
user.fromaddr
user.home =
user.language.display
user.language.format
user.mailcap
user.name =
user.script
user.script.display
user.script.format
user.timezone
user.variant.display
user.variant.format
userEncoding
userdir=
useshape
useswing
usetransl
verificationStrategy
version.resource.missing
vmprops.dump
xyz

At least the list is to the point where it can be manually inspected.  I know for a fact it’s still missing some properties.  For instance, I know there is a property for blacklisting SSL certificates and I don’t see it in the list.  Perhaps there are properties accessed via native methods or methods other than System.getProperty().

Ok so why all the work, why not just print out a list of property settings like the following?

import java.util.*;
public class MyClass {
public static void main(String args[]) {
Properties properties = System.getProperties();
properties.forEach((k, v) -> System.out.println(k + ":" + v));
}
}

Internal properties are often unassigned default.  So if you’re expecting a boolean property to be assigned to false and show up in System.getProperties() you will be disappointed.

Please follow and like us:

Author: milton

For bio see, https://www.securitycurmudgeon.com/about/