在运行网页正常的Jar文件与小程序的帮助 [英] Run normal Jar file in web page with the help of applet

查看:136
本文介绍了在运行网页正常的Jar文件与小程序的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Java中创建一个JAR文件,其中包含外部库与类文件一起(以使其更复杂)。我们的使命是莫名其妙地运行在网络这个程序。

I have a Jar file created in Java which contains external libraries along with class files (to make it more complicated). Our mission is to somehow run this program on web.

小程序被用来在HTML运行Java,但我的问题是我的罐子是不是Applet的瓶子,所以我不能在applet标记罐子,所以我应该重写所有我的Java code作为applet或有任何简单方式只是将我罐子小程序罐子,包括HTML?

Applets are used to run Java on HTML but my problem is my jar is not Applet Jar so I can't include jar in applet tag, so should I rewrite all my java code as applet or is there any simple way as to just convert my jar to applet jar and include on HTML?

推荐答案

启动基于帧的应用程序。使用 Java Web Start的。

Launch the frame based app. from a link using Java Web Start.

没有它不是基于帧的,它实际上是通过串行端口连接打印机应用程序,所以现在我试着从头小程序来重写

No it is not frame based, it is actually printer application via serial port connection, so right now im trying to rewrite in applet from scratch

要得到它在客户端的工作(容易为客户端)将要求要么是嵌入(或自由浮动)applet或自由浮动框架使用JWS启动。任你选。需要注意的是,除非code为数字签名(由你)和信任(最终用户),这将无法打印。

To get it to work on the client-side (easily for the client) will require either an embedded (or free-floating) applet or a free floating frame launched using JWS. Take your pick. Note that unless the code is digitally signed (by you) and trusted (by the end user) it will not be able to print.

有可让沙箱应用程序的服务。使用JWS打印部署,但它不会是具体的访问串口,并需要改变code。

There is a service available to allow sand-boxed apps. deployed using JWS to print, but it would not be as specific as accessing the serial port, and would require changes to the code.

我有点困惑,当你提到的'转换',以为你的意思,它是基于在一个自由的浮动框架。现在,你能解释一下它既不是一个applet或框架,使一些更明确的我。

I got a bit confused when you mentioned 'convert' and thought you meant that it was based in a free floating frame. Now you explain it is neither an applet or frame makes something more clear for me.

..我应该重写所有我的Java code小程序?

..should I rewrite all my java code as applet?

没有,当然没有。你只需把jar添加到小程序的运行时类路径中使用归档属性,然后从的init称之为()的start()(如适用)一个非常简单的小应用程序的方法。

No, of course not. You just add that Jar to the run-time class-path of the applet using the archive attribute, then call it from the init() or start() (as appropriate) methods of a very simple applet.

不过我还是建议使用JWS一种使用小程序的自由浮动框架。在code代表要么是容易的,但是小应用程序部署了很多困难。

But I still recommend using JWS for a free floating frame over using an applet. The code for either is easy, but applet deployment is a lot harder.

这篇关于在运行网页正常的Jar文件与小程序的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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