michalrus / git-hooks-code-autoformat

Apache License 2.0
87 stars 24 forks source link

Error on git-commit #14

Closed a-t-u-l-k closed 6 years ago

a-t-u-l-k commented 6 years ago

Error on git-commit. ######################################################################## 100.0% http://download.eclipse.org/eclipse/updates/4.4/R-4.4.2-201502041700/plugins/org.eclipse.text_3.5.300.v20130515-1451.jar ######################################################################## 100.0% Recompiling /d/athenaC/athena-jetty-daemons/.git/hooks/tools/eclipse-java-formatter/src/ejf/Main.java ... Error: Could not find or load main class ejf.Main fatal:ejffailed for: D:/athenaC/athena-jetty-daemons/projects/Provisioning/src/main/java/com/oracle/athena/provisioning/controller/ChatCredentialsController.java

a-t-u-l-k commented 6 years ago

Change to git-hooks/tools/eclipse-java-formatter directory, and execute following:

d="$(cd "$(dirname "$0")"; pwd -P)" lib_classpath="$(find "$d/lib/" -name '*.jar' | tr '\n' ':')" src="$d/src/ejf/Main.java" bin="$d/bin" cls="$d/bin/ejf/Main.class" if [ "$src" -nt "$cls" ] ; then echo "Recompiling $src ..." javac -cp "$lib_classpath" -d "$bin" "$src" touch -r "$src" "$cls" fi style="$(find "$d/lib/" -name '*.xml' | head -n 1)" java -cp "$lib_classpath:$bin" ejf.Main "$style" src/ejf/Main.java

It will compile ejf/Main.java, and this bug will be fixed.