程序打成jar包问题,求教,在线等
各位大哥,小弟写了个小程序,想打包成jar来运行,但运行起来总是错。
麻烦帮忙看下啊,感激不尽啊
我是这么干的,自己写了个MANIFEST.MF放在程序目录下,程序结构如图:
ProjectName
|-Src
|-andy.fanancial.imagepanel
|-andy.fanancial.login
|-andy.fanancial.mainframe
|-andy.fanancial.test
|-andy.fanancial.user.dao
|-jdbc.properties
|-log4j.properties
|-SqlMapConfig.xml
|-images
|-lib
|-MANIFEST.MF
MANIFEST.MF内容如下:
Manifest-Version: 1.0Class-Path: lib/commons-logging.jar lib/ibatis-2.3.0.677.jar lib/log4j-1.2.14.jar lib/mysql-connector-java-3.1.13-bin.jarMain-Class: andy.fanancial.login.LoginForm
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger at andy.fanancial.login.LoginForm.<clinit>(LoginForm.java:40)Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more