问题
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?
回答1:
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>
来源:https://stackoverflow.com/questions/19214798/how-do-i-deploy-my-java-application-onto-a-website