My old laptop is failing, so I transferred a java program to a new computer, but am having difficulty executing the program. I'm using eclipse, and in order to remove the "missing main class" error added the target directory to the build path. Now, I get the error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at source.Application.<clinit>(Application.java:447)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader$1.run(Unknown Source)
...
The class path file includes the line
classpathentry kind="lib" path=".../log4j/log4j-1.2.17/apache-log4j-1.2.17/log4j-1.2.17.jar" sourcepath=".../log4j/log4j-1.2.17/apache-log4j-1.2.17/log4j-1.2.17-sources.jar">
So, I'm not sure about what to try next.
In the java build path / libraries tab, the entries are:
External jar: C:\Users\John\Documents\java\log4j\log4j-1.2.17\apache-log4j-1.2.17\log4j-1.2.17.jar source attachment: C:\Users\John\Documents\java\log4j\log4j-1.2.17\apache-log4j-1.2.17\log4j-1.2.17-sources.jar javadoc location: C:\Users\John\Documents\java\log4j\log4j-1.2.17\apache-log4j-1.2.17\log4j-1.2.17-javadoc.jar
The main class has a class member
private static final Logger LOGGER = Logger.getLogger(Application.class);
The main function has the lines
PropertyConfigurator.configure("log4j.properties"); LOGGER.error(e);