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. -- Summary: error trying to exec 'ecj1' - also - SuppressWarnings cannot be resolved to a type Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rob1weld at aol dot com GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32712