Page 1 of 2

Java Map Editor, errors

Posted: Tue Oct 26, 2004 1:42 am
by Casper
Java map editor does not compile under javac 1.5, you need 1.4.

Since 1.5 will now be default on most systems you need to tell ant to use 1.4 explicitly.

If jdk1.4 does not come as part of your distribution it can be downloaded from http://java.sun.com .

First set your working directory to where the sources are.

Next ensure your database is up to date.

Code: Select all

$ su
# updatedb
# exit
Next find where the 1.4 java compiler is kept on your system

Code: Select all

$ locate javac
/usr/lib/jdk1.4.2/bin/javac
You should see something like that... I only have 1.5.0 so this is expected output. If you don't see a line that says .../1.4.x/bin/javac you do not have jdk1.4 installed, you need to download it and install it from http://java.sun.com . Next set your $JAVA_PATH to where the 1.4.2 is:

Code: Select all

$ JAVA_HOME=/usr/lib/jdk1.4.2
Now ant wil know where to look for a compiler :). Finally, run ant!

Code: Select all

$ ant
ant is like make but uses xml and is for java. If you don't have ant it can be downloaded from http://ant.apache.org/bindownload.cgi .

After compiling you should end up with a jar file lying about somewhere :)

For a Windows system most of the above applies. Instead of updating and searching your file database you would need to use the find file sidebar of Explorer (something like Ctrl+F5 or F6?), and environment variables are set from right click My Computer > Properties > Advanced > Environment Variables. You may need to log on and off or restart for changes to take effect. Command prompt is found by hitting [Window Key]+R, typing "cmd" into the box that comes up, and hitting enter.

Posted: Tue Oct 26, 2004 2:28 am
by Salathar
Ok thanks, done all that. Infact got rid of 1.5 and installed latest 1.4.

As soon as I run ant it starts trowing exceptions at me :x

I had confirmation from two people so far that the latest cvs java editor does not compile. This is an issue and needs reporting, had a quick look at the cf bugtracker , could not find a place to submit CFJavaEditor bugs/issues, will look there again.

Or perhaps could someone post or pm me a link to the appropriate place to submit the issue? :)

Posted: Tue Oct 26, 2004 2:53 am
by Leaf
I've added a category for the map editor on the bug report page at SourceForge.

https://sourceforge.net/tracker/?group_ ... tid=113833

Posted: Tue Oct 26, 2004 4:46 am
by Salathar
Leaf, thanks alot for moving this post and adding the category :)

Good news is, I got if finally working now! :)
I've no idea what was wrong, my best guess is that there was some kind of a conflict between javac and the runtime environment that I had which resulted in fatal exceptions. Removing everything java related , putting fresh 1.4.2_6 sdk and ant made it magically work. :D

Posted: Tue Oct 26, 2004 9:09 am
by Casper
Well done! It's probably a good idea to make the jar file publically avaliabe somewhere.

I don't think most people would be willing to downgrade their javac just so the map editor compiles.

Posted: Tue Oct 26, 2004 4:28 pm
by Salathar
Ok, I made a package now which is avalibale at
http://bsucab.uwcs.co.uk/CFJavaEditor/C ... tor.tar.gz

Posted: Tue Oct 26, 2004 4:52 pm
by Leaf
Salathar wrote:Ok, I made a package now which is avalibale at
http://bsucab.uwcs.co.uk/CFJavaEditor/C ... tor.tar.gz
Please provide a md5 sum

=)

Posted: Tue Oct 26, 2004 5:28 pm
by Salathar
leaf wrote: Please provide a md5 sum

=)
Done :)
Both .md5 and .tar.gz files can be found at http://bsucab.uwcs.co.uk/CFJavaEditor/

Posted: Tue Oct 26, 2004 8:14 pm
by Casper
To run the editor you will need to use this java command:

Code: Select all

$ java -jar CFJavaEditor.jar
Also in Konqueror you can right click on the jar and select Open with... java -jar

Posted: Thu Nov 18, 2004 5:08 am
by AndreasV
Don't worry, I just fixed this. The editor should now compile and run on 1.5 (as well as on 1.4 and 1.3, hopefully). :)

The compile problem was caused by the use of 'enum' as variable name, which has become a reserved system keyword with Java 1.5.

I just hadn't tried 1.5 before. Amazing, a lot has changed. Glad there weren't any more trouble than this. The switch from 1.3 to 1.4 was considerably more difficult.