public class CloneTest
{
public static void main(String[] args)
{
Date d = new Date();
System.out.println( d.toString() );
}
}上面代码,如果按 Ctrl + F11 运行就没问题。如果按F11,那调试窗口输出下面的东西
CloneTest [Java 应用程序]
本地主机 52205 处的 CloneTest
线程 [main](已暂挂(异常 FileNotFoundException))
FileInputStream.open(String) 行: 不可用 [本机方法]
FileInputStream.<init>(File) 行: 不可用
ZoneInfoFile$1.run() 行: 不可用
AccessController.doPrivileged(PrivilegedExceptionAction<T>) 行: 不可用 [本机方法]
ZoneInfoFile.readZoneInfoFile(String) 行: 不可用
ZoneInfoFile.createZoneInfo(String) 行: 不可用
ZoneInfoFile.getZoneInfo(String) 行: 不可用
ZoneInfo.getTimeZone(String) 行: 不可用
TimeZone.getTimeZone(String, boolean) 行: 不可用
TimeZone.setDefaultZone() 行: 不可用
TimeZone.getDefaultRef() 行: 不可用
Date.normalize() 行: 不可用
Date.toString() 行: 不可用
String.valueOf(Object) 行: 不可用
PrintStream.println(Object) 行: 不可用
CloneTest.main(String[]) 行: 11
D:\JDK\bin\javaw.exe(2012-7-26 下午02:49:47)
CloneTest [Java 应用程序]
本地主机 52216 处的 CloneTest
线程 [main](已暂挂(异常 FileNotFoundException))
FileInputStream.open(String) 行: 不可用 [本机方法]
FileInputStream.<init>(File) 行: 不可用
ZoneInfoFile$1.run() 行: 不可用
AccessController.doPrivileged(PrivilegedExceptionAction<T>) 行: 不可用 [本机方法]
ZoneInfoFile.readZoneInfoFile(String) 行: 不可用
ZoneInfoFile.createZoneInfo(String) 行: 不可用
ZoneInfoFile.getZoneInfo(String) 行: 不可用
ZoneInfo.getTimeZone(String) 行: 不可用
TimeZone.getTimeZone(String, boolean) 行: 不可用
TimeZone.setDefaultZone() 行: 不可用
TimeZone.getDefaultRef() 行: 不可用
Date.normalize() 行: 不可用
Date.toString() 行: 不可用
<旧方法,位于><未知声明类型>>
D:\JDK\bin\javaw.exe(2012-7-26 下午02:51:33)
CloneTest [Java 应用程序]
本地主机 52223 处的 CloneTest
线程 [main](已暂挂(异常 FileNotFoundException))
FileInputStream.open(String) 行: 不可用 [本机方法]
FileInputStream.<init>(File) 行: 不可用
ZoneInfoFile$1.run() 行: 不可用
AccessController.doPrivileged(PrivilegedExceptionAction<T>) 行: 不可用 [本机方法]
ZoneInfoFile.readZoneInfoFile(String) 行: 不可用
ZoneInfoFile.createZoneInfo(String) 行: 不可用
ZoneInfoFile.getZoneInfo(String) 行: 不可用
ZoneInfo.getTimeZone(String) 行: 不可用
TimeZone.getTimeZone(String, boolean) 行: 不可用
TimeZone.setDefaultZone() 行: 不可用
TimeZone.getDefaultRef() 行: 不可用
Date.normalize() 行: 不可用
Date.toString() 行: 不可用
CloneTest.main(String[]) 行: 11
D:\JDK\bin\javaw.exe(2012-7-26 下午02:52:45)
CloneTest [Java 应用程序]
本地主机 52344 处的 CloneTest
线程 [main](已暂挂(异常 FileNotFoundException))
FileInputStream.open(String) 行: 不可用 [本机方法]
FileInputStream.<init>(File) 行: 不可用
ZoneInfoFile$1.run() 行: 不可用
AccessController.doPrivileged(PrivilegedExceptionAction<T>) 行: 不可用 [本机方法]
ZoneInfoFile.readZoneInfoFile(String) 行: 不可用
ZoneInfoFile.createZoneInfo(String) 行: 不可用
ZoneInfoFile.getZoneInfo(String) 行: 不可用
ZoneInfo.getTimeZone(String) 行: 不可用
TimeZone.getTimeZone(String, boolean) 行: 不可用
TimeZone.setDefaultZone() 行: 不可用
TimeZone.getDefaultRef() 行: 不可用
Date.normalize() 行: 不可用
Date.toString() 行: 不可用
CloneTest.main(String[]) 行: 11
D:\JDK\bin\javaw.exe(2012-7-26 下午02:57:42)
解决方案 »
- JPanel添加了JButton之后不能显示
- 一个JTable 放在JScrollPane中,如果这个JTable有50行,而JScrollPane中一页只能显示20行,我想让JTable 从第25行开始显示,怎么做?
- 直连2005起了怪的问题
- 如何将double数写到文件中去
- 关于键盘事件的问题
- 请问怎么实现在一个字符串中查找另一个子串的算法(不用String类提供的方法)
- 写文件操作为什么在LINUX和WINDOWS下的结果会不一样?!!?
- 如何设置mysql的jdbc驱动程序的classpath
- 帮忙解释一下String对象间传递字符串的问题.
- 再问appletviewer,98下不可用
- 帮帮忙,java中提示报错:cannot find symbol。不知道哪里错了
- 文本域按行读取的问题
我机器只有jdk 所以我编译了下你写的 根本就编译不过去。
DateFormat df = new SimpleDateFormat("yyyy-yy-yy");
String birthday = df.format(date);
{
public static void main(String[] args)
{
Date d = new Date();
System.out.println( d.toString() );//System.out.println( d );//一样效果
}
}
结果:
Thu Jul 26 15:24:33 CST 2012
你还是用myeclipse吧。