java class bytes,java.lang.ClassFormatError:类文件末尾的额外字节

I'm getting an odd error when I try and run this program. The class compiles fine into multiple .class files and I compiled it last week (before editing it) just fine. But now, I see this:

Exception in thread "main" java.lang.ClassFormatError: Extra bytes at the end of class file blah/hooplah/fubar/nonsense/IndexId$Transaction

From what I've looked up, Java 6 build 1.5 could fix it since it allows extra bytes at the end of class files (I think), but I would much rather use build 1.6.

I'm editing on Windows and then FTP-ing the .java files over to an OpenVMS machine where I then compile them. after compiling I move the .class file into a directory created from exploding the previous jar file and then re-jar.

Any clear ideas on how this happened or how to fix it?

解决方案

The problem was solved by removing all Line Feeds from the .java file and properly renaming it(OpenVMS defaults to all lower case unless told not to)

Sadly a failure on my part by not testing between each but at least it works.

In short:

-Line Feeds are bad AND Name files properly (Java standards not OS standards)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值