问题
I have an Eclipse installation on a multi-user Linux system at /opt/eclipse/
.
Unfortunately, because of a defect in m2eclipse-mavenarchiver, this plugin uses a folder in a system temporary directory that is common for all users (this manifests as a "permission denied" message for a pom.xml
file).
I planned to specify a unique value for java.io.tmpdir
in a common eclipse.ini
based on a user name, but it turned out that it is not possible.
One option is to have a per-user installation of Eclipse where each eclipse.ini
would have its own value of java.io.tmpdir
(e.g., -Djava.io.tmpdir=/tmp/eclipse/john_doe
).
Is that possible to have a single multi-user Eclipse installation but somehow specify a unique value for java.io.tmpdir
for each user?
回答1:
I suggested in my comment that you could make your own custom script to launch Eclipse. Even in a way that the same script may serve for every user:
/opt/eclipse/eclipse -vmargs -Djava.io.tmpdir=/tmp/eclipse/$USER
回答2:
As @Little Santi advises in a comment, a customized per-user launcher can be used. You could specify the desired path as a command-line argument for a JVM:
/opt/eclipse/eclipse -vmargs -Djava.io.tmpdir=/tmp/eclipse/john_doe
To be on the safe side, make sure the specified directory exists and has correct ownership and access rights.
来源:https://stackoverflow.com/questions/51324406/how-to-specify-a-unique-java-io-tmpdir-for-each-user-of-a-multi-user-eclipse-ins