Setting -Djava.security.manager on the @run gives me an AccessControlException
from jtreg. I could work around this by creating a policy file, I guess.
Exception in thread "main" java.security.AccessControlException: access denied
("java.io.FilePermission"
"/Users/staffan/mercurial/jdk8-tl/jdk/JTwork/classes/java/util/TimeZone/Bug6912560.jta"
"read")
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:364)
at
java.security.AccessController.checkPermission(AccessController.java:560)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
at java.io.FileInputStream.<init>(FileInputStream.java:125)
at java.io.FileInputStream.<init>(FileInputStream.java:91)
at java.io.FileReader.<init>(FileReader.java:58)
at com.sun.javatest.regtest.MainWrapper.main(MainWrapper.java:45)
On 27 nov 2012, at 14:57, Alan Bateman <[email protected]> wrote:
> On 27/11/2012 12:26, Staffan Larsen wrote:
>>
>> :
>>
>> The test installs a security manager and that has to be present during the
>> call to getDefault() when getDefault() does the real work (not just reading
>> from the cache). Setting -Duser.timezone will not help as the only fix.
>>
> What I mean is change the @run line to this:
>
> @run main/othervm -Djava.security.manager -Duser.timezone= Asia/Tokyo ...
>
> I have not tried it to know if the "/" will cause a problem on Windows.
>
> -Alan.