I have a script which normally i run using ./myscript.sh(contain java run command) on linux. Now i want to make it as a service so it run automatically after machine restart
You need to write systemd service file.
Simplest script looks like this:
[Unit] Description=Virtual Distributed Ethernet [Service] ExecStart=/usr/bin/YOUR_SCRIPT [Install] WantedBy=multi-user.target
Also you need: systemctl daemon-reload after creating new service.
systemctl daemon-reload