diff --git a/configure.in b/configure.in
index ef9585b..953f272 100644
--- a/configure.in
+++ b/configure.in
@@ -69,6 +69,8 @@ if test -z "$JAVAH"; then
 fi
 AC_SUBST(JAVAH)
 
+AC_SUBST(JAVACFLAGS)
+
 AC_PATH_PROG(JAR,jar,,${JAVA_PATH})
 if test -z "$JAR"; then
   AC_MSG_ERROR([$JAVA_ERROR_MESSAGE])
@@ -85,7 +87,7 @@ if test "x$with_jdk_auto_detect" = "xyes"; then
 	CUR_DIR=`pwd`
 	SRC_DIR=`dirname $0`
 	SRC_DIR=`cd $SRC_DIR;pwd;cd $CUR_DIR`
-	$JAVAC $SRC_DIR/JavaInfo.java
+	$JAVAC $JAVACFLAGS $SRC_DIR/JavaInfo.java
 	JDK_HOME="`CLASSPATH=$SRC_DIR $JAVA JavaInfo`"
 else
 	if test -z "$JDK_HOME"; then
diff --git a/wrapper/org/GNOME/Accessibility/Makefile.am b/wrapper/org/GNOME/Accessibility/Makefile.am
index 55c6165..8e4b9e5 100644
--- a/wrapper/org/GNOME/Accessibility/Makefile.am
+++ b/wrapper/org/GNOME/Accessibility/Makefile.am
@@ -11,7 +11,7 @@ AtkWrapper.java : AtkWrapper.java.in
 		< $< >$@
 
 %.class : %.java
-	CLASSPATH=$(top_srcdir)/wrapper $(JAVAC) -d $(top_builddir)/wrapper $<
+	CLASSPATH=$(top_srcdir)/wrapper $(JAVAC) $(JAVACFLAGS) -d $(top_builddir)/wrapper $<
 
 clean-local:
 	$(RM) *.class
