如何在 IceWM 启动时 运行 java GUI?
How to run a java GUI at startup in IceWM?
我一直在尝试 运行 java 在 IceWM linux 中基于 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
也有适当的权限。感谢帮助。
终于找到解决办法了!显然是 sudo
出了问题..
所以我将 /path/to/java/binaries
引用到 /etc/sudoers/
文件并从 /home/loggeduser/.profile
启动 java
文件(我这样做是因为我的系统只有一个用户)并完成..重新启动,我有 Java GUI 运行。
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.
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)
我一直在尝试 运行 java 在 IceWM linux 中基于 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
也有适当的权限。感谢帮助。
终于找到解决办法了!显然是 sudo
出了问题..
所以我将 /path/to/java/binaries
引用到 /etc/sudoers/
文件并从 /home/loggeduser/.profile
启动 java
文件(我这样做是因为我的系统只有一个用户)并完成..重新启动,我有 Java GUI 运行。
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.
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)