Linux 环境中普通用户启动Myeclipse出错

  将Myeclipse安装在/usr/local/myeclipse目录中,由root用户启动时没有问题,而用普通用户时出现如下故障:

The configuration area at '/usr/local/myeclipse/configuration' is not writable.  Please choose a writable location using the '-configuration' command line option.

意思就是/usr/local/myeclipse/configuration对于普通用户来说是不可写的,当让可以将/usr 及其所有的子目录都变成 777的权限,但是毕竟不安全。在这句话的后边提示可以通过配置 -configuration参数来改变configuration目录的位置。 我们希望当每个用户启动myeclipse的时候都有自己的配置目录,因此可以通过一个简单脚本实现以下。

脚本名就为myeclipse,可以直接通过这个脚本来对myeclipse进行配置,然后启动myeclipse。

#!/bin/bash

if [ "$USER" == "root" ]; then
  workpath=/root/myeclipse
else
  workpath=/home/$USER/myeclipse
fi

if [ ! -d "$workpath" ]; then
  mkdir -p $workpath
fi

/usr/local/myeclipse/myeclipse -configuration $workpath

将此myeclipse脚本放在/usr/local/bin目录中,这样任何用户都可以调用,并且,每个用户都有自己的配置目录。

原文地址:https://www.cnblogs.com/linux-wangkun/p/5771115.html