ubuntu运行java程序,如何在Ubuntu Linux启动时运行Java应用程序

该博客讲述了如何将一个Java编写的无GUI TCP/IP Socket监听程序配置为在Linux系统启动时自动运行。作者已经成功创建了一个Java程序,现在需要使其在Linux开机时自动启动。解决方案建议创建一个服务包装器来运行Java应用,并通过`update-rc.d`命令在Ubuntu上设置开机启动。
摘要由CSDN通过智能技术生成

I have a requirement where I need to develop application that reads TCP/IP Socket. I successfully made the program as Java program with No GUI means as soon as program runs it starts listening to the Socket and gets the response with the help of Netbeans IDE. Now as per my requirement i have to start execution of this program as soon as Linux system Booted.

Actually I am very novice in Java and Linux Platform, so have few doubts..

Is my Socket Program with no GUI is fine to be run as per my requirement.

How can I write script to run jar on Linux Boot up, I got to know. init.d is meant for this.

解决方案

Ideally you should create a service wrapper for your java application and then make this service run on startup example here.

Use

sudo update-rc.d mytestserv defaults to run your service wrapper on startup on Ubuntu

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值