可执行的JAR文件 [英] Executable JAR File

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

问题描述

HI


假设在Java中有一个HELLO WORLD应用程序

当我在命令提示符下运行它时,它正在打印Hello World

在控制台窗口中


下一次当我制作相同应用程序的可执行jar并试图在命令提示符下运行jar时

什么都没发生我的意思是它不打印Hello World。


我希望你有我的问题,如果没有请注明。


提前致谢

解决方案


HI


假设有一个HELLO WORLD应用程序在java中


当我在命令提示符下运行它时,它正在打印Hello World。

在控制台窗口中


下一次当我制作相同应用程序的可执行jar并试图在命令提示符下运行jar时

什么都没发生我的意思是它不打印Hello World。


我希望你有我的问题,如果没有请注明。


在此先感谢



1.)你是如何制作jar文件的?

2.)是否有任何内容写入控制台运行时?



1.)你是如何制作jar文件的?

2。 )运行时是否有任何内容写入控制台?



通过ant script.But我确信JAR没有问题

因为我试图创建文件时为例如( c:sample.txt)通过它工作的同一个应用程序


只有System.out.println();
当我试图运行时,
无效jar

休息一切正常



通过ant script.But我相信没有问题JAR

因为当我试图通过同一个应用程序创建文件(例如:c:sample.txt)时它工作了


only System.out.println ();
当我试图运行jar时
没有效果

其余全部工作



您在清单文件中指定Main-Class属性?


HI

Suppose There is a HELLO WORLD Application in java

When I am running this in a command prompt it is printing the "Hello World"
in a console window

Next Time When i make the executable jar of the same application and tried to run the jar at Command prompt
Nothing happened I mean it is not printing "Hello World".

I hope you got my question if not please specify.

Thanks in advance

解决方案

HI

Suppose There is a HELLO WORLD Application in java

When I am running this in a command prompt it is printing the "Hello World"
in a console window

Next Time When i make the executable jar of the same application and tried to run the jar at Command prompt
Nothing happened I mean it is not printing "Hello World".

I hope you got my question if not please specify.

Thanks in advance

1.) How did you make the jar file?
2.) Is there anything being written to the console when you run it?


1.) How did you make the jar file?
2.) Is there anything being written to the console when you run it?


through ant script.But I am sure that there is no problem in JAR
because when I tried to create the file for eg(c:sample.txt) through the same application it worked

only System.out.println();
has no effect when I tried to run the jar
rest all is working


through ant script.But I am sure that there is no problem in JAR
because when I tried to create the file for eg(c:sample.txt) through the same application it worked

only System.out.println();
has no effect when I tried to run the jar
rest all is working

Did you specify the Main-Class attribute in the manifest file?


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

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