2

Simple but important:

  1. Where to change default JDK settings of an installed Java per OS (Linux, Windows, Mac) for Oracle or OpenJDK?
  2. How to see which options are currently set?

Background: Over years of Java development for different systems I have learned there are always some important Java options to be set to get best performance for either system. This might be related to special memory configuration or simply annoying bugs in a special JDK version in combination with a special OS version/graphics configuration and so on.

Thomas
  • 1,622
  • 17
  • 24

2 Answers2

2
  1. A valid method is to specify the environment variable: JAVA_TOOL_OPTIONS
  2. java -XshowSettings shows the current settings for the current JVM in a shell, some help how to set environment variables: MacOs, Linux, Windows
Thomas
  • 1,622
  • 17
  • 24
1

You can specify environment variables for all the options

  • Environment variables "only" can be specified in a shell/command line environment but not for applications directly calling a JVM, so this is not very helpful. Further more please try to answer more detailed. – Thomas Oct 22 '16 at 10:29
  • at some point in the call stack you need a shell. what more details do you need? – Peter Gelderbloem Oct 22 '16 at 10:35
  • @Thomas programs always run with environmental variables. Your only other option is to build your own JDK. – Peter Lawrey Oct 22 '16 at 10:43
  • So you say there is no way to say a JVM which default options to use by a configuration file? Are you very sure? I can not believe it somehow. Do you have some background? The problem I have: every program/application has its own way of startup/environment and so on. But if it is such a fiddling I must accept of course. ;-) – Thomas Oct 22 '16 at 11:00
  • some environments don't have file systems – Peter Gelderbloem Oct 22 '16 at 12:14