java.opt file adding -D parameters

2 views (last 30 days)
Bill
Bill on 19 Feb 2013
Matlab version R2012a Linux
So I want to be able to add various jVM "-D" parameters to the "java.opt" file so that when matlab starts up the JVM these are passed in and accessible with the System.getProperty() function. I want students to be able to pass in things like the IP address of a database server, etc. etc. to the various java classes called.
I have looked high and low and there seems to be no definitive answer to this.
I have tried:
java.opt in the working directory. java.opt in the %MATLABROOT/bin/[ARCH] directory.
and neither seem to work. Am I approaching this wrong or ??
Little help would be appreciated.
  1 Comment
Raymond Norris
Raymond Norris on 20 Feb 2013
That's odd. With R2012b on Windows 7, I've defined java.opts as such:
-DRunTime=12hrs
and placed it in $matlab/bin/$arch. Then in MATLAB, I run:
>> java.lang.System.getProperty('RunTime')
ans =
12hrs
>>

Sign in to comment.

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!