-1

I have been trying to run java based GUI onBoot in IceWM linux, tried to run it through different runlevels..rc3, rc4, and rc5 but couldn't run it. here what I am trying..

sudo java -jar /path/to/jar in a /etc/init.d/script and linking it like

sudo ln -s /etc/init.d/script /etc/rc3.d/S99script

I also made sure that the script has proper permissions too. Help is appreciated.

Arnab Nandy
  • 6,472
  • 5
  • 44
  • 50
Ahmed S. Durrani
  • 1,535
  • 2
  • 17
  • 41

3 Answers3

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)
Poo
  • 213
  • 1
  • 6
  • 18
0

At last I found the solution! Apparently it was the sudo that was making problem..

So I referenced /path/to/java/binaries into /etc/sudoers/ file and started java file from /home/loggeduser/.profile (I did this because there is only one user to my system) and done..rebooted and I have the Java GUI running.

Ahmed S. Durrani
  • 1,535
  • 2
  • 17
  • 41
-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.  
Poo
  • 213
  • 1
  • 6
  • 18