1

I am having a rather nasty problem with windows 2008 server. We have a java application that is running as a service using the local services user. The problem is this user does not have access to read/write to the specified java tmp directory (specified by the system). This means that every time the application tries to create a tmp file an IOException is thrown.

Is there any way to make a java application that need access to the tmp directory run as a service without:

  • Creating a new user specifically for the purspose
  • Specifying a new tmp directory (which you will have to clean up yourself)
  • 4

    2 回答 2

    0

    您是否有理由不能授予“NT AUTHORITY\LocalService”帐户写入 Java 的默认临时目录的权限?

    于 2010-04-15T18:24:03.337 回答
    0

    来自http://www.rgagnon.com/javadetails/java-0484.html

    用于保存临时文件的目录位置由属性 java.io.tmpdir 定义。
    可以使用用于启动 JVM 的命令行更改默认值:

    java -Djava.io.tmpdir=C:\mydir  myClass
    

    或者,在 Windows 上,您可以将环境变量 TMP 设置为不同的值。

    于 2010-04-15T18:36:42.717 回答