When I’m in Eclipse my project compiles with no errors, however when I try to compile with javac it says I’m missing some packages…
I copied my compile command and some of the error text below:
javac -classpath lib/ -d bin/ src/*.java
src/Cleaner.java:5: package net.sourceforge.jgeocoder does not exist
src/MyUtilities.java:19: package org.apache.commons.codec.binary does not exist
In Eclipse, I have added all the .JAR files to the build-path, and the program compiles just fine.
Why can it not find the jars when I use javac instead of the Eclipse IDE?
-classpath lib/will causejavacto look for a tree of class files inlib. If you have JAR archives there, you have to use-classpath lib/*.jar– and probably use whatever escaping mechanism your CLI has on the * to make sure it reachesjavacrather than being expanded by the CLISee the javac command reference (windows).