From mboxrd@z Thu Jan 1 00:00:00 1970 From: D-Man To: sourcenav@sources.redhat.com Subject: Re: Using SourceNav for Java Date: Thu, 01 Mar 2001 11:31:00 -0000 Message-id: <20010301143053.C24127@harmony.cs.rit.edu> References: X-SW-Source: 2001-q1/msg00179.html On Tue, Feb 27, 2001 at 04:53:28PM -0500, Brad Cox wrote: | I've subscribed to this list after trying everything else I could | think of to get Java compiling via SN and GCJ. Can't seem to make it | find the core java libraries (java.io.*). I've tried including the | .jars as files, as directories, by expanding the jars into | directories and including the files as files and as directories). | Nothing works. | | How does SN regard jars anyway? As includes? As directories? As | files? As linker command line options? | | Thanks! I'd really appreciate the help. | I regularly use SN to compile a java project. This particular project has an ant build file (ant is similar to make but is simpler and only works for Java stuff). I have a .bat file which then executes bash (from cygwin) to run a shell script that runs ant with the proper VM options (ant is a java program). How are you "including" your jar files? They must be in the CLASSPATH environment variable, or given to the JVM (java or javac) on the command line with the -classpath option. For example, my shell scrip that runs ant : # some variables to make the script less redundant ANT_HOME="d:\\apps\\ant" ANT_LIB="$ANT_HOME\\lib" ANT_JAR="$ANT_LIB\\ant.jar;$ANT_LIB\\jaxp.jar;$ANT_LIB\\parser.jar;" `cygpath --unix "$JAVA_HOME\\bin\\java"` \ -mx80m \ -classpath "${JAVA_HOME}\\lib\\tools.jar;${CLASSPATH};${ANT_JAR}" \ -Dant.home=$ANT_HOME \ org.apache.tools.ant.Main $* Oh, yeah, you said you were using gcj, not Sun's jdk. I have used gcj before, but not for anything very significant. Check its commandline options. You probably need to include it with some sort of classpath option. If you are using gcj to compile to native, I don't know how it handles jar files. As for the standard libary stuff, it is included in libgcj.so (a shared library file). AFAIK the standard library is implemented as C++. It might be in Java at the source level, and then compiled to C++ object code by gcj, but I've gotten linker errors before that looked like C++ symbols. (after the Java parsing front-end gcj uses g++'s C++ backend for object files and linking) BTW, the jar file must be in the classpath, not the directory the jar file is in. HTH, -D