[英]EXE JAR not functioning as expected
I have created an .exe
jar file of my project using JartoExe
application(NetBeans 7.1.2 JDK7 ).Now for some classes it works just fine.But it does not shows up the GUI for/and after the specific class . 我已经使用
JartoExe
应用程序(NetBeans 7.1.2 JDK7)为我的项目创建了一个.exe
jar文件。现在对于某些类来说它可以正常工作,但是在特定类之后和之后都不会显示GUI。
I have included all the dependencies needed.But the GUI won't show up after a perticular class.What is wrong with .exe
file?Have I missed something? 我已经囊括了所有的needed.But GUI不会出现后perticular class.What是错误的依赖关系
.exe
文件?我错过了什么?
UPDATE On the Console, it's throwing FileNotFound
Exception.My files are in the current project folder.So, what should i need to change? 更新在控制台上,它引发
FileNotFound
Exception。我的文件在当前项目文件夹中,所以我需要更改什么?
Is this because of getClass().getResourceAsStream()
? 这是因为
getClass().getResourceAsStream()
吗?
Exception details: 例外详情:
Mar 07, 2013 10:57:07 PM projectfinal.KaraokeTest$3 run
SEVERE: null
java.io.FileNotFoundException: Na Kajre Ki Dhar.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at projectfinal.KaraokeTest.initComponents(KaraokeTest.java:89)
at projectfinal.KaraokeTest.<init>(KaraokeTest.java:35)
at projectfinal.KaraokeTest$3.run(KaraokeTest.java:375)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
通常,罐子没有目录。因此getClass().getResourceAsStream(somefile)
应该是getClass().getResourceAsStream("\\somefile")
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.