[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Meaning of "error: Java source seen but 'GCJ' is undefined"?

From: David Ventimiglia
Subject: Meaning of "error: Java source seen but 'GCJ' is undefined"?
Date: Sat, 2 Aug 2014 09:36:03 -0700


I'm trying to use Automake to compile Java and am getting this error when I
run automake:

    error: Java source seen but 'GCJ' is undefined

There also are some instructions about how to define GCJ using AM_PROG_GCJ,
but the thing is, I don't want to use gcj.

My looks something like this.

    bin_PROGRAMS = foo.jar
    foo_jar_SOURCES = foo.args
    OBJEXT = jar
    BUILT_SOURCES = foo.args
    SUFFIXES = .args

        -mkdir -p $(builddir)/address@hidden
        @JAVAC@ $(JAVACFLAGS) $(AM_JAVACFLAGS) -d $(builddir)/java @<
        @JAR@ -cf $(builddir)/$@ -C $(builddir)/address@hidden .

        echo $? > $@

It probably isn't clear from the code, so what I'm trying to do is this.

1. Avoid Automake's built-in Java support, since it's deprecated.
2. Use an argument file named 'foo.args' (see javac docs) containing names
of all Java source files to be built, in order to avoid command-line length
3. Use Automake's support for new file types (Automake manual, section
18.2) to teach Automake how to make a .jar file from a .args file (along
the way, using javac to compile sources).

The specific problem I seem to be encountering is that, as soon as I use
*.jar (and/or, perhaps *.java) in a primary, Automake detects it and says,
"Oh, I see you're building Java.  You'll need GCJ for that."

I've grepped through the Automake source in order to find this logic, learn
how it works, and devise a strategy for circumventing it, but failed.

Where is this error coming from?  And, how do I avoid it?  Thanks!

David A. Ventimiglia

reply via email to

[Prev in Thread] Current Thread [Next in Thread]