开云体育

Locked Re: Compilling and running JMRI


 

At 3:54 PM +0000 8/12/02, sixth_rule wrote:
Ok i got rid of the other 3 errors and am now down to these 2

i got rid of the first 3 errors by changing
import com.sun.java.util.collections.linkedlist yo
import java.util.linked list
Sorry, but this is not progress. The error is because you're not picking up the classes in "collections.jar", which should be in the "lib" directory one level above the "java" directory.

By changing that name, you're using a _different_ class from the Java distribution. It won't interoperate with the serial libraries.

the lines in question look as follows


Error
"LocoNetMessage.java": Error #: 302 : cannot access class
org.apache.log4j.Category; java.io.IOException: class not found:
class org.apache.log4j.Category at line 226, column 29
corisponds to line

static org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(LocoNetMessage.class.getName());

and Error
"LnTrafficController.java": Error #: 302 : cannot access class
org.apache.log4j.Category; java.io.IOException: class not found:
class org.apache.log4j.Category at line 75, column 26
corrisponds to line

static org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance
(LnTrafficController.class.getName());

becasue of the com.sun.java errors i am worried about the org.apache
part of the code becasue that looks like a web adress
also why is it log4j instead of just log ?
"log4j" is the name of the package containing the "Category" class. Actually, the complete name of the package is "org.apache.log4j". Those are defined in the "log4j.jar" file in the "lib" directory, which has to be located by the compiler. That's the same problem we're trying to resolve, so hopefully these will all clean up at the same time once we get that.

"log" is a variable that's defined at the bottom of the file. But the _type_ of that variable, e.g. the class info needed by the compiler, has to come from the class definition in a jar file.

i don't see where log4j has been previously declaired
i have been playing around with the wording in this line but have yet
to fix this part

any help would be helpful

Chad Spickett

i also checked in my c:\jb1.0.3\java dir and here is what is there:
classes/
cvs/
doc/
src/
test/
jmri.jpx
jmri.jpx.local
jmri.jpx.local~
JMRILibraries.library

i think the last one was the one you wanted to know if it was there

could there be any class path settings i have wrong or do i have to
> move that library file into jdk1.3.1/lib ???
The "JMRILibraries.library" file is text, and points to the location of the .jar file that JBuilder will use during compilation. It should contain lines like:

<path>[../lib/log4j.jar]</path>

which say that the library "one directory up and then in the lib folder" is needed.

So please check that there's a C:&#92;jn1.0.3&#92;lib directory, and that it contains 7 .jar files, a README file (not needed) and a "security.policy" file (only needed at runtime)

Bob
--
--------------
Bob Jacobsen (Bob_Jacobsen@..., 510-486-7355, fax 510-495-2957)

Join [email protected] to automatically receive all group messages.