我一直在尝试在IceWM linux中运行基于java的GUI onBoot,尝试通过不同的运行级别运行它... rc3,rc4和rc5但是无法运行它。 在这里我正在努力..
sudo java -jar /path/to/jar
中的 /etc/init.d/script
并将其链接为
sudo ln -s /etc/init.d/script /etc/rc3.d/S99script
我还确保script
也具有适当的权限。感谢帮助。
答案 0 :(得分:1)
1)login with your user then use "ls -a" command.you can find .bash_profile file.
2)suppose still you dont have then create manually "vi .bash_profile" in your home directory(eg. vi /home/user/.bash_profile)
3)give 755 permission to bash_profile .(chmod 755 /home/user/.bash_profile)
4)then edit vi .bash_profile
export JAVA_HOME=(Path of ur java location- {eg. /opt/jdk1.6.0_45})
export PATH=$PATH:(Path of ur java location- {eg. /opt/jdk1.6.0_45})
PATH=$PATH:$HOME/bin
:wq (save and exit)
5)run .bash_profile (sh .bash_profile)
答案 1 :(得分:0)
最后我找到了解决方案!显然是sudo
正在制造问题..
所以我将/path/to/java/binaries
引用到了/etc/sudoers/
文件中并从java
启动了/home/loggeduser/.profile
文件(我之所以这样,因为我的系统只有一个用户)并完成了...重新启动,我运行Java GUI。
答案 2 :(得分:-1)
For Linux
+Go to Home directory of user.(eg:- cd /home/user)
+every user having ".bash_profile" file in home directory.(ls -a --> to check hidden (.)file)
+you can give path or export java in ".bash_profile.
eg:- vi /home/user/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export JAVA_HOME=/opt/jdk1.6.0_45
export PATH=$PATH:/opt/jdk1.6.0_45
#export JBOSS_HOME=/jbossdev/brms-standalone-5.3.1/jboss-as
#export PATH=$PATH:/jbossdev/brms-standalone-5.3.1/jboss-as/bin
PATH=$PATH:$HOME/bin
export PATH
:wq!
+then grant 755 permission to .bash_profile file (chmod -R 755 /home/user/.bash_profile).
+execute sh .bash_profile.
so now you can run it through different runlevels..rc3, rc4, and rc5.