make(1) and Java don't play very well together, because unless you're careful you end up starting a new VirtualMachine for every file you want to compile (see the 'classes' target below for a complete hack). Remember that tabs and spaces get confused when cutting and pasting (see MakeFile).
JAVAC=javac JAVACOPTIONS= -g:none -O #make a .class file from a .java file %.class: %.java $(JAVAC) $(JAVACOPTIONS) $< # JAVACC stuff #name/location of javacc executable JAVACC=/home/say1/bin/javacc #javacc options JAVACCOPTIONS=-SANITY_CHECK=true -FORCE_LA_CHECK=true -DEBUG_PARSER=true -DEBUG_TOKEN_MANAGER=true # build a java file from a JavaCC file %.java: %.jj $(JAVACC) $(JAVACCOPTIONS) $< # a target that builds all the .java files in sight classes: $(JAVAC) $(JAVACOPTIONS) *.java */*.java */*/*.java
Sometimes javac/Java complains that it can't find files which are plainly there or complains that they're in the wrong place. This is almost always a classpath or a package interaction problem. If the file is not in a package and is in the current directory:
If the file is in a package:
Check to make sure that the filename of the .java file has the same name as the class inside the file.
A JAR file (or Java Archive) is a zip file used to distribute a set of compiled Java classes with some associated metadata. It might be just a library, but could also be an application; in that case, you have to run it via the JVM:
java -jar $JAR_FILE
lib/main.php:944: Notice: PageInfo: Cannot find action page