I have inherited a large number of Java files with classes I am trying to call from Mathematica via J/Link. They are legacy and am not at liberty to modify. A few are used on command-line scripts (with static methods, no constructors [hence no JavaNew]). Unfortunately they require the user to launch the JVM at a specific directory.
Loading Java in Mathematica via J/Link with
neither changes the current working directory nor
System.getenv(someEnvironmentVariable) return "someValue."
Question: How to make the JVM (or J/Link?) use these values ("theSpecificDirectoryName" as its current working directory and "someEnvironmentVariable") in Mathematica?