Create the Start/stop Script on Ubuntu

sudo cp /etc/init.d/skeleton /etc/init.d/mydaemon
sudo chmod +x /etc/init.d/mydaemon
sudo vi /etc/init.d/mydaemon
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Description of the service"
NAME=daemonexecutablename
DAEMON=/usr/bin/$NAME
DAEMON_ARGS="--options args"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

Install Daemonize on ubuntu

$ git clone git://github.com/bmc/daemonize.git

$ sh configure
$ make
$ sudo make install

Install C Compiler on Ubuntu

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
$ gcc -v
$ make -v

set environment path on ubuntu

  • create new file under /etc/profile.d/
    sudo vi /etc/profile.d/SCRIPT_NAME.sh
    
  • add there:
    export PATH=YOUR_PATH_WITHOUT_TRAILING_SLASH:$PATH
    
  • and give right on executable
    sudo chmod a+x /etc/profile.d/SCRIPT_NAME.sh

Edit

/etc/profile
~/.profile
~/.batchrc

Install Orable Java SDK on Ubuntu

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
or
sudo apt-get install oracle-java8-installer


update 

sudo update-alternatives --config java

sudo update-alternatives --config javac
setup JAVA_HOME

sudo nano /etc/environment
JAVA_HOME="YOUR_PATH"
source /etc/environment