问题描述
我刚刚编译了所有Java程序,其中包括4个类,并且一切正常.我的GUI,客户端,服务器,动作监听器和图像都在同一文件夹中.我只是不知道如何将在JGrasp软件中调试和测试的本地Java应用程序放到我的网页上.我环顾四周,我读到您需要制作一个jar文件并压缩所有文件,但是我不知道该怎么做,也没有创建applet.我尝试通过尝试将.java文件"SMTPServer"(用于运行该应用程序的类)转换为JNLP文件,并启动Java WebStart Application的方法,但尝试了最简单的方法,但无法运行它.这是我第一次尝试将其移植到网页上.我该怎么做?
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部署为applet或应用程序.您可以在 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应用程序部署到网站上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!