【发布时间】:2014-09-09 06:07:46
【问题描述】:
有一个 jar 文件已经部署并成功运行。现在我们需要在一个类中添加一个非常小的字符串。
These are the steps so far i made:
1.) I already decompile/extract the jar into a folder.
2.) Open a class file in JDgui(java file viewer).
3.) Copy the source code in notepad++ and save as fileName.java
4.) Compile that .java as .class via cmd.
5.) Compile the folder again as .jar file (the same as the old .jar which is running)
现在当我重新启动 Tomcat 时,运行系统,然后它显示错误:
ClassNotFoundException
当我在 JDGui 中打开该 jar 文件时,该类就在其中。
请帮忙。谢谢
【问题讨论】:
-
确保类文件的名称和包相同。
-
您是如何实现以下目标的:4。)通过 cmd 将该 .java 编译为 .class。没有错误?
-
@BatScream - 当我尝试在 cmd 中将 fileName.java 编译为 .class usign javac 时,会发生很多错误,然后我调试所有错误并成功。然后我现在创建了 .class 文件。当我尝试将新的 .class 文件与旧文件进行比较时,除了使用的变量之外,它们是相同的。
-
你在用netbeans吗?
标签: java class jar classnotfoundexception