将JAR作为独立的可执行文件 [英] Make JAR as a standalone executable

查看:112
本文介绍了将JAR作为独立的可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将JAR lib转换为独立的JAR?
我需要找到一个将PDF转换为TIFF的独立java可执行文件,我找到了这些JAR: http://www.icefaces.org/JForum/posts/list/17504.page

Is there a way to convert JAR lib into JAR standalone? I need to find a standalone java executable that convert PDF into TIFF and I've found these JARs: http://www.icefaces.org/JForum/posts/list/17504.page

任何想法?

推荐答案

最简单的方法可能是使用Main()入口点创建另一个Jar,然后使用java.exe可执行文件运行它:

Easiest might be to create another Jar with a Main() entry point, and then just use the java.exe executable to run it:

例如

> java.exe -cp MyJarMain.jar;MyPDFJar.jar com.mydomain.MyMain myPDF.pdf

其中MyMain是一个带有Main静态方法的类。

Where MyMain is a class with a Main static method.

你需要一些带有主入口点的东西来传入并解释一些命令行参数(我的myPDF.pdf)制作的例子)

You'll need something with a main entry point to pass in and interpret some command line arguments (myPDF.pdf in my made-up example)

这篇关于将JAR作为独立的可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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