Is there any way of launching Oracle's Java.exe and have it take its command line options from a text file on Windows?
What I'd like to be able to do is something like this:
java.exe -optionsFile=myOptionsFile.txt MyClass
where 'myOptionsFile.txt' contains a list of standard Java VM options such as "-classpath="my very long classpath" and "-Dthis=that" etc.
All of the options must be present when Java.exe is run as it is the target of a memory debugging tool called VMMap. VMMap allows you to launch a .exe and attach to it in order to debug native heap issues. In this case, I cannot generate the command line args at runtime or have another process launch java.exe for me.
-classpath
alone is (much of) the problem, use envvarCLASSPATH
instead, or wildcards, or fat jar(s) (3) Otherwise, it may work to use envvar_JAVA_OPTIONS
and/orJAVA_TOOL_OPTIONS
– Swagertyjava
read from a file, because that is not going to happen. If you do not edit your question do not expect any better answers that you have now. Just trying to help and provide some guidance on how to succeed on the site. – Em