自从我编写了任何程序之后已经有好几年了,但是我编写了这个小程序来帮助解决我们在工作中遇到的问题。我做了一些关于如何制作jar文件的功课,并遵循了这些步骤。当我尝试执行创建的jar文件时,没有任何反应。有人能指引我朝着正确的方向吗?Jar文件将不会执行
源代码:
import java.io.*;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class CardOutput
{
public static void main(String[] args) throws IOException
{
String inputA;
JFrame parent = new JFrame();
boolean truth = true;
while(truth)
{
inputA = JOptionPane.showInputDialog("Please Swipe Card");
if(inputA.length() == 0)
{
truth = false;
}
else if(inputA.length() != 14)
{
inputA = JOptionPane.showInputDialog("Invalid Card Number \n" + "Please Swipe Card");
}
else
{
JOptionPane.showMessageDialog(parent, "Your Card Number is " + inputA.substring(4,13));
}
}
JOptionPane.showMessageDialog(parent, "Program is now ending");
System.exit(0);
}
}
清单文件行:主类:CardOutput.class
批处理文件I创建以形成.jar文件:
@ECHO OFF
C:
CD "C:\Users\timmcj\Desktop\CardOutput
"C:\Program Files\Java\JDK1.7.0_09\bin\jar.exe" cvfm CardOutput.jar manifest.txt *.class
PAUSE
典型的“循环永远”是'while(true){...}'。国际海事组织使用一个变量来模糊事物,特别是当“真实==虚假”时。 –