如何将我的 Java 应用程序部署到网站上? [英] How do I deploy my java application onto a website?

查看:42
本文介绍了如何将我的 Java 应用程序部署到网站上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚编译了我所有的 Java 程序,其中包含 4 个类,并且一切正常.我的 GUI、客户端、服务器、动作侦听器和图像都在同一个文件夹中.我只是不知道如何将我在 JGrasp 软件中调试和测试的本地 java 应用程序放到我的网页上.我环顾四周,我读到您需要制作一个 jar 文件并压缩所有文件,但我不知道该怎么做,也不知道如何创建小程序.我尝试了最简单的方法,尝试转换 .java 文件SMTPServer"(用于运行应用程序的类)并将其转换为 JNLP 文件,然后它启动了 Java WebStart 应用程序,但无法运行它.这是我第一次尝试将其移植到网页上.我该怎么做?

I just complied all my java programs, which consists of 4 classes and everything's working fine. I have the GUI, client, server, and the action listeners and an image all in the same folder. I just don't know how to put my local java application that I debugged and tested in JGrasp software onto my webpage. I looked around and I read you need to make a jar file and compress all of them, but I don't know how to do that, neither creating an applet. I tried the most simple way of doing it by attempting to convert the .java file "SMTPServer", the class used to run the application, and convert that into a JNLP file and it brought up a Java WebStart Application, but was unable to run it. This is my first time trying to port it to the webpage. How do I do this?

推荐答案

这个基本的示例混合.JAR 包含一个类.JAR 可以部署为小程序或应用程序.您可以在 JGrasp 中构建包含已编译类文件的 JAR,如图 这里.

This basic example is a hybrid. The JAR contains a single class. The JAR can be deployed as either an applet or application. You can build a JAR containing your compiled class files in JGrasp as shown here.

<resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="YourApplication.jar"/>
</resources>

这篇关于如何将我的 Java 应用程序部署到网站上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆