Question

I found a traffic light simulator called Green Light District the file I download included and explanation of how to build the project and it says the following

Extract the archive to a certain directory,
In that dir do javac gld/*.java
In that dir do java gld.GLDSim

I know * means all but... first I want to know am I able to compile something like *.java this is a link to the simulator , if some one can tell how to compile it , it would be really nice http://sourceforge.net/projects/stoplicht/

Was it helpful?

Solution

The issue occurs due to the fact that "enum" became reserved word in Java 1.5+, so it can no longer be used as a name for variables/methods/classes, but GLD uses enum as a name for some variables.

Once the name is changed - project will compile.

Alternatively one can try to compile it with compiler setting source version 1.4 - this should probably also work, but I suggest to simply rename all variables named enum.

OTHER TIPS

Basically, all the code is in the folder called gld. You need to compile all the .java files inside it. After that, you run the main class gld.GLDSim.

Had the same problem. You should use Java 1.4, this simulator is quite old, hence uses an old version of Java and some preserved words in more advanced Java versions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top