I’m trying to compile my java file to class.
It is a plugin to a much larger program and it runs fine from eclipse when running from source.
I work in Linux, and in shell I type the following javac MyPlugin.java
This is just some of the output:
MyPlugin.java:11: package javolution.util does not exist
import javolution.util.FastList;
^
MyPlugin.java:12: package javolution.util does not exist
import javolution.util.FastMap;
^
MyPlugin.java:14: package org.apache.log4j does not exist
import org.apache.log4j.Logger;
^
MyPlugin.java:15: package org.jwebsocket.api does not exist
import org.jwebsocket.api.PluginConfiguration;
^
My assumption is that the rest of the errors are caused because the imports cannot be reached.
Do I need to add something to the original command to have these imports included?
You are missing jars from the following projects:
http://javolution.org/
http://logging.apache.org/log4j/1.2/
http://jwebsocket.org/
You can download the missing JARs and include them in your compilation classpath.
Alternatively, you could let maven manage the download and compilation of your application.
Update: Gathering all external jars together in one location
To get all your external libraries in one place you could create a runnable JAR in eclipse using:
Enter
your_temp_jar.jarand clickAfter clicking
Finishall the required jars will be in a folder calledyour_temp_jar_lib.