Bug 32712 - error trying to exec 'ecj1' - also - SuppressWarnings cannot be resolved to a type
Summary: error trying to exec 'ecj1' - also - SuppressWarnings cannot be resolved to a...
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-10 08:05 UTC by Rob
Modified: 2007-07-10 17:09 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob 2007-07-10 08:05:57 UTC
I am compiling a program and the Makefile wants to use Javac. I _did_ use the "1.5" option but still got an error about "SuppressWarnings cannot be resolved to a type".


I decided to see what GCC 4.3 had to say about the file. I have 4.3 installed in /usr/test .


/usr/test/bin/gcc /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0_810/hpcviewer/src/edu/rice/cs/hpcviewer/app/ApplicationActions.java
gcc: error trying to exec 'ecj1': execvp: No such file or directory

Typing "locate ecj1" finds nothing. Typing "locate ecj" finds many hits (mostly "ecj" is part of a DOCs name) and I do have a "/usr/bin/ecj" but no
"/usr/test/bin/ecj".


So lets try the GCC (4.1) that does have an ecj it could use.


# gcc /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0_810/hpcviewer/src/edu/rice/cs/hpcviewer/app/ApplicationActions.java
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0_810/hpcviewer/src/edu/rice/cs/hpcviewer/app/ApplicationActions.java:40: error: Invalid character '@' in input.
@SuppressWarnings("serial")
   ^
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0_810/hpcviewer/src/edu/rice/cs/hpcviewer/app/ApplicationActions.java:20: error: Class or interface 'edu.rice.cs.hpcviewer.view.HPCViewerWindow' not found in import.
import edu.rice.cs.hpcviewer.view.HPCViewerWindow;
          ^
2 errors


Since I need 5 for the annotation I pursue 4.1 no further, lets "-v" it.


gcc -v /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0_810/hpcviewer/src/edu/rice/cs/hpcviewer/app/ApplicationActions.java 
...
/usr/libexec/gcc/i686-pc-linux-gnu/4.2.0/jc1 /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0_810/hpcviewer/src/edu/rice/cs/hpcviewer/app/ApplicationActions.java -quiet -dumpbase ApplicationActions.java -mtune=athlon-xp -march=athlon-xp -auxbase ApplicationActions -version -o /tmp/ccsDPdP6.s
...


So that means GCC (at least 4.1 version, maybe not 4.3) wants to use "jc1" and NOT "ejc1". I locate that here: "/usr/test/libexec/gcc/i686-pc-linux-gnu/4.3.0/jc1".


The driver must look there for "jc1" and not look anywhere for "ejc1" (unless the GCC 4.3 build would like to create and install "ejc1".


If I try to run "jc1" with the options from above I get:

# /usr/test/libexec/gcc/i686-pc-linux-gnu/4.3.0/jc1 /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0_810/hpcviewer/src/edu/rice/cs/hpcviewer/app/ApplicationActions.java -o ApplicationActions.s
/opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0_810/hpcviewer/src/edu/rice/cs/hpcviewer/app/ApplicationActions.java:0: warning: no input file specified

Execution times (seconds)
 parser                :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 (33%) wall       0 kB ( 0%) ggc
 TOTAL                 :   0.02             0.00             0.03               1230 kB


So lets try help ...


# /usr/test/libexec/gcc/i686-pc-linux-gnu/4.3.0/jc1 --help
The following options are specific to the language Ada:
  -feliminate-unused-debug-types        [enabled]
  -gnat<options>              

The following options are specific to the language C:
 No options with the desired characteristics were found

The following options are specific to the language C++:
 No options with the desired characteristics were found

The following options are specific to the language Fortran:
  -J<directory>               
  -Waliasing                  
  -Wampersand                 
  -Wcharacter-truncation      
  -Wimplicit-interface        
  -Wline-truncation        
...


It then prints all the Fortran options (how useful), the Java options, even some langtree options (and I did not specify langtree to the configure!).
It continues to list every "-W", "-f", "--param option", "-W" again, then "-f" options, "target specific" options, "language-independent" options and a whole lot more.

Could it be a bit less verbose?


Looking through those dozen pages of (no) help it is not very clear why "jc1" says "no input file specified".


So the bug is that I can't use an installed copy of GCC 4.3 to compile a ".java" file by typing "gcc file.java" because the driver looks for an executable that does not exist. 

Trying "-v" with GCC 4.1 to guess what to type with 4.3 gives a suggestion that does not work with 4.3 - so I'm a bit stuck trying to help myself. I can see something is wrong with the setup.

To top it off. Even through I can not compile this file I can get it pre-compiled as a ".jar" file off the website at: http://www.hipersoft.rice.edu/hpctoolkit/examples.html

The file is http://www.hipersoft.rice.edu/hpctoolkit/examples/HPCViewer.jar.gz (and you will likely want on of the data files to examine, they are small).

When I click on that Jar file with WinXP it runs fine (Sun JDK) but if I try to open it on GNU/Linux with Iceweasel it won't work (but other Java seems OK - weeks ago).


If I start Iceweasel and click on the jar file I get this message:
Exception in thread "main" java.lang.NoClassDefFoundError: /opt/HPCToolkit-OneStopShopping-TRUNK-4/9/0=810/hpcviewer/build-unix/HPCViewer/jar


With GCC 4.2 gij I get this message:

# gij -jar HPCViewer.jar

(.:5821): Gtk-WARNING **: Unable to locate theme engine in module_path: "qtengine",
java.lang.InternalError: Gtk: Unable to locate theme engine in module_path: "qtengine",
   at java.lang.reflect.Constructor.newInstance(natConstructor.cc:71)

(.:5821): Gtk-WARNING **: Unable to locate theme engine in module_path: "qtengine",
java.lang.InternalError: Gtk: Unable to locate theme engine in module_path: "qtengine",
   at java.lang.reflect.Constructor.newInstance(natConstructor.cc:71)
/root/downloads/gcc-4_2-branch/libjava/classpath/native/jni/gtk-peer/gthread-jni.c:1223: AWT JNI failure (BROKEN): cannot enter monitor

Description follows to System.err:
java.lang.NullPointerException
   at java.lang.Object.getClass(natObject.cc:55)
/root/downloads/gcc-4_2-branch/libjava/classpath/native/jni/gtk-peer/gthread-jni.c:1223: Aborting execution; BROKEN: cannot enter monitor

Aborting execution
Aborted



With GCC 4.3 gij I get this message:


Exception in thread "main" java.lang.NoClassDefFoundError: /opt/HPCToolkit-OneStopShopping-TRUNK-4/9/0=810/hpcviewer/build-unix/HPCViewer/jar

cd /opt/HPCToolkit-OneStopShopping-TRUNK-4.9.0=810/hpcviewer/src
/usr/test/bin/gij -jar HPCViewer.jar

Starts (creates the 'open file' dialog window), but gives error message:

(.:5841): Gtk-WARNING **: Unable to locate theme engine in module_path: "qtengine",
java.lang.InternalError: Gtk: Unable to locate theme engine in module_path: "qtengine",
   at java.lang.reflect.Constructor.newInstance(natConstructor.cc:92)

(.:5841): Gtk-WARNING **: Unable to locate theme engine in module_path: "qtengine",
java.lang.InternalError: Gtk: Unable to locate theme engine in module_path: "qtengine",
   at java.lang.reflect.Constructor.newInstance(natConstructor.cc:92)
failure while exiting GTK monitor
Exception during event dispatch:
java.lang.IllegalMonitorStateException: current thread not owner
   <<No stacktrace available>>

I do configure GCC to build Java with "--with-x --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --enable-java-awt=gtk,xlib --enable-gtk-cairo --enable-qt-peer --enable-xmlj --enable-gconf-peer" and it passes many mauve tests (and ALL the GCC testsuite). There is something about the way GCC builds gij that does not let it run .jar files that work perfectly on the WinXP platform with Internet Explorer.

In Internet Explorer, if I click [Tools][Sun Java Console], it says I have this version:
Java Plug-in 1.6.0_01
Using JRE version 1.6.0_01 Java HotSpot(TM) Client VM


# /usr/test/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /root/downloads/gcc-4_3-trunk/configure --verbose --enable-languages=c,ada,c++,fortran,java,objc,obj-c++ --prefix=/usr/test --enable-objc-gc --disable-multilib --with-gxx-include-dir=/usr/test/include/c++/4.3 --enable-libstdcxx-debug --enable-static --enable-shared --enable-initfini-array --enable-__cxa_atexit --enable-threads=posix --enable-version-specific-runtime-libs --enable-libssp --enable-libmudflap --enable-libgomp --disable-werror --enable-nls --with-included-gettext --enable-decimal-float --enable-debug --enable-java-gc=boehm --with-x --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --enable-java-awt=gtk,xlib --enable-gtk-cairo --enable-qt-peer --enable-xmlj --enable-gconf-peer --enable-tool-wrappers --enable-portable-native-sync --enable-examples --with-dwarf2 --with-stabs --enable-hash-synchronization --enable-gc-debug --enable-interpreter --with-system-zlib --enable-libada --with-tls --with-tune=athlon-xp --with-cpu=athlon-xp --with-arch=athlon-xp --enable-stage1-checking=assert,df,fold,gc,misc,rtl,rtlflag,runtime,tree
Thread model: posix
gcc version 4.3.0 20070630 (experimental)


When I run "make -i -k check" the libjava testsuite passes.

Thanks.
Comment 1 Andrew Pinski 2007-07-10 15:13:42 UTC
This is not a bug, please read: http://gcc.gnu.org/gcc-4.3/changes.html
Java (GCJ)

gcj now uses the Eclipse Java compiler for its Java parsing needs. This enables the use of all 1.5 language features, and fixes most existing front end bugs.

And also read:
http://gcc.gnu.org/ml/java/2006-12/msg00070.html
Comment 2 Daniel Jacobowitz 2007-07-10 16:12:54 UTC
Subject: Re:  error trying to exec 'ecj1' - also -
	SuppressWarnings cannot be resolved to a type

On Tue, Jul 10, 2007 at 03:13:42PM -0000, pinskia at gcc dot gnu dot org wrote:
> This is not a bug, please read: http://gcc.gnu.org/gcc-4.3/changes.html
> Java (GCJ)
> 
> gcj now uses the Eclipse Java compiler for its Java parsing needs. This enables
> the use of all 1.5 language features, and fixes most existing front end bugs.
> 
> And also read:
> http://gcc.gnu.org/ml/java/2006-12/msg00070.html

It Would Be Nice if it were easier to figure out what you had to do,
though.  Non-gcj-hackers don't know to look in contrib for a magic
script.

Comment 3 Rob 2007-07-10 17:09:03 UTC
I was told in my other bug report to file my 'java problem' seperatly - so I did.

gcc-4.2 file.java
gcc: error trying to exec 'ecj1': execvp: No such file or directory


How is it "not a bug" for GCC 4.3 to attempt to execute a non-existant file?

If the gcc driver should run "gcj" or "ejc" then be my guest but what is the point of attempting to execuate a non-existant file ?