在公司服务器上部署java文件
我在本地电脑上有一个用 Netbeans IDE 编写的 java 文件。我必须将此文件部署到公司服务器上。 基本上,该文件充当侦听器,侦听发送警报的另一台服务器。我的程序捕获这些警报并将其存储在 SQL Server 数据库中。 现在,要连接到警报服务器,我需要将我的文件放在公司服务器上。我的文件需要连续运行(监听)警报。我需要向警报服务器提供我的 IP 地址和端口号以进行连接。
我需要知道如何在公司服务器上部署 java 文件并保持其运行。
谢谢。
I have a java file written in Netbeans IDE on my local pc. I have to deploy this file on the company server.
Basically, this file acts as a listener and it listens to another server that sends out alarms. My program captures these alarms and stores it in sql server database.
Now, to connect to the alarm server, i need to place my file on the company server. my file needs to run (listen) continuously for the alarms. I need to provide my ip address and port number to the alarm server for connection.
I need to know how do i deploy my java file on my company server and keep it running.
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您要做的第一件事是让程序在本地工作站(NetBeans 之外)上运行;一旦你破解了它,你就有机会让它在远程服务器上运行。
我猜这是一个简单的java应用程序(即一个带有 public static void main(String[] args) 方法的类)。如果是这样,请启动命令提示符,切换到 Java 类所在的目录并使用 JDK 编译它:
这将为您提供一个 class 文件(即 MyClass.class),您可以然后运行:
一旦成功,您可以将MyClass.class复制到服务器并以相同的方式从那里运行它(假设服务器已经安装了Java运行时环境)。
希望能为您指明正确的方向...
The first thing you do is get the program running on your local workstation (outside of NetBeans); once you have that cracked you have a chance of getting it running on the remote server.
I'm guessing that this is a simple java applicaiton (ie with a class with a public static void main(String[] args) method in it). If so fire up the command-prompt, change to the directory in which your Java class sits and compile it using the JDK:
This will give you a class file (ie MyClass.class), that you can then run:
Once it works, you can copy MyClass.class to the server and run it from there in the same way (assuming the server already has a Java Runtime Environment installed).
Hope that points you in the right direction...