I try to compile my first robot and I get error messages. So I searched in this forum and googled the problem but all I can find is that jikes isnt the best solution and that it is better to use javac. No one is writing the compiler options which I have to type in the three lines of the compiler references (perhaps on windows it is different?).
I use ubuntu and robocode 1.7.1.4 Beta. If I look at the compiler references there are three lines! What do I have to write in each line, if I use javac?
I tryed it of course by my own but I get every time diffrent error messages which says that the options I choose are not correct. Sorry I cant tell it exactly because Iam not at home at the moment. I will post the exactly errors this evening, if there is no solution till then.
So please, show me what compiler references do you have in this three lines?
regards,
denke
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@ Flemming N. Larsen
Oh man, thanks a lot for your help!!! It works!!!
As I read your answer I recognised that I havent installed the development kid of java.
I installed it via synaptic (I prefer that way) and the rest was like you wrote.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What do you mmean by conpiler references? If you mean the -g -deprecation -cp robocode.jar , you can always press the Compiler > Conpiler Options > Reset Compiler at any time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes thats it. At least 30% of the qoestion.
There are THREE lines on ubuntu in the compiler references! If I reset the compiler there is always jikes in the first line. But as I have seen in many forums jikes isnt good. If I change it into javac there are some other errors which alwas say that the option I have chosen is no option. I looked already in the man pages of javacc but that wont help me either.
So, please someone give me the information of all this three lines completly for javac under ubuntu.
Thanks,
denke
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you mean that it doesn't find javac in your system? Are you able to type javac in your command line? You should set the path to cover the javac. And it would be nice if you post the error. I didn't run Robocode on ubuntu seriously, but I think the default option work fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Found 2 semantic errors compiling "/home/punky/robocode/robots/cln/Strepitus.java":
8.publicclassStrepitusextendsRobot^-------^
*** Semantic Error: The class file "BulletHitBulletEvent.class" in "libs/robocode.jar/robocode" has an invalid format (duplicate local variable type table).
8.publicclassStrepitusextendsRobot^-------^
*** Semantic Error: The class file "BulletHitEvent.class" in "libs/robocode.jar/robocode" has an invalid format (duplicate local variable type table).
Compile Failed (1)
If I google this problem I find many hints which say all the same. Change jikes into javac.
Javac I find under: /usr/lib/jvm/cacao/bin/javac
This I type in the first line. Then I get following error:
Compiling...
Unable to compile!
Exception was: java.io.IOException: Cannot run program "/usr/lib/jvm/cacao/bin/javac" (in directory "/home/punky/robocode"): java.io.IOException: error=2, No such file or directory
Does /usr/lib/jvm/cacao/bin/javac exist?
OK, then I type only "javacc" in the FIRST line and get following error message:
Compiling...
Java Compiler Compiler Version 4.1d1 (Parser Generator)
(type "javacc" with no arguments for help)
Warning: Bad option "-deprecation" will be ignored.
Warning: Bad option "-g" will be ignored.
Warning: Bad option "-Xstdout" will be ignored.
Argument "+T4" must be an option setting.
Compile Failed (1)
The man pages of javacc says for example: javacc -STATIC=false -LOOKAHEAD:2 -debug_parser mygrammar.jj and this is what I type in the second line.
Then I get the following error message:
Compiling...
Java Compiler Compiler Version 4.1d1 (Parser Generator)
(type "javacc" with no arguments for help)
Argument "javacc" must be an option setting.
Compile Failed (1)
So, I think I cant handle the javacc option. Can someone please post his compiler preferences (all three lines please) of javacc under ubuntu.
Thanks,
denke
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When you see the compiler error like for the BulletHitBulletEvent class, then you are using Jikes for compiling, and hence it also complaints about the javac options, which does not match Jikes options. So you need to shift to the javac, and I will help you with exactly that.
I have reproduced your scenario under Ubuntu 9.04, and the reason why Robocode does not "see" javac, so it defaults to Jikes must be that you have not installed the proper JDK package.
What you need to do is:
1) Check if you have javac installed. In a terminale, you should write this in your terminale:
javac
If it writes out "The program 'javac' can be found in the following packages:", you need to install either sun-java5-jdk or sun-java6-jdk. You should use sun-java5-jdk if you want to be on the safe side. Now write this in your terminale:
sudo apt-get install sun-java5-jdk
When this is done you have installed Sun's JDK 5 which includes the javac compiler.
2) If you already had the JDK installed or you have just installed it, you should not write the following in your terminale:
sudo update-alternatives --config javac
Now select the version you want, e.g. the one for "/usr/lib/jvm/java-1.5.0-sun/bin/javac" if you install the sun-java5-jdk.
3) Finally, write this into the terminale:
javac -version
It should now write out information about which version of javac you are using. :-)
Now restart Robocode, and start the Robot Editor (Robot -> Editor). Robocode might give a dialog saying that it found javac and ask you if you want to use it? If so, press "Yes" and you will be using javac. If not, then reset the compiler in the Robot Editor (Compiler -> Options -> Reset Compiler). Now it should be able to locate javac, and it will automatically change the settings for you.
I really hope this helps! :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I try to compile my first robot and I get error messages. So I searched in this forum and googled the problem but all I can find is that jikes isnt the best solution and that it is better to use javac. No one is writing the compiler options which I have to type in the three lines of the compiler references (perhaps on windows it is different?).
I use ubuntu and robocode 1.7.1.4 Beta. If I look at the compiler references there are three lines! What do I have to write in each line, if I use javac?
I tryed it of course by my own but I get every time diffrent error messages which says that the options I choose are not correct. Sorry I cant tell it exactly because Iam not at home at the moment. I will post the exactly errors this evening, if there is no solution till then.
So please, show me what compiler references do you have in this three lines?
regards,
denke
@ Flemming N. Larsen
Oh man, thanks a lot for your help!!! It works!!!
As I read your answer I recognised that I havent installed the development kid of java.
I installed it via synaptic (I prefer that way) and the rest was like you wrote.
Thanks
What do you mmean by conpiler references? If you mean the -g -deprecation -cp robocode.jar , you can always press the Compiler > Conpiler Options > Reset Compiler at any time.
Yes thats it. At least 30% of the qoestion.
There are THREE lines on ubuntu in the compiler references! If I reset the compiler there is always jikes in the first line. But as I have seen in many forums jikes isnt good. If I change it into javac there are some other errors which alwas say that the option I have chosen is no option. I looked already in the man pages of javacc but that wont help me either.
So, please someone give me the information of all this three lines completly for javac under ubuntu.
Thanks,
denke
Do you mean that it doesn't find javac in your system? Are you able to type javac in your command line? You should set the path to cover the javac. And it would be nice if you post the error. I didn't run Robocode on ubuntu seriously, but I think the default option work fine.
Hello,
and thank you for your fast answer.
I did a compiler resest and the three lines of the compiler Preferences says:
Compiler Binary: ./jikes-1.22/bin/jikes
Compiler Options: -deprecation -g -Xstdout +T4
Compiler Classpath: -classpath /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/rt.jar:libs/robocode.jar:/home/punky/robocode/robots
With this settings I get after comiling:
Compiling...
Found 2 semantic errors compiling "/home/punky/robocode/robots/cln/Strepitus.java":
*** Semantic Error: The class file "BulletHitBulletEvent.class" in "libs/robocode.jar/robocode" has an invalid format (duplicate local variable type table).
*** Semantic Error: The class file "BulletHitEvent.class" in "libs/robocode.jar/robocode" has an invalid format (duplicate local variable type table).
Compile Failed (1)
If I google this problem I find many hints which say all the same. Change jikes into javac.
Javac I find under: /usr/lib/jvm/cacao/bin/javac
This I type in the first line. Then I get following error:
Compiling...
Unable to compile!
Exception was: java.io.IOException: Cannot run program "/usr/lib/jvm/cacao/bin/javac" (in directory "/home/punky/robocode"): java.io.IOException: error=2, No such file or directory
Does /usr/lib/jvm/cacao/bin/javac exist?
OK, then I type only "javacc" in the FIRST line and get following error message:
Compiling...
Java Compiler Compiler Version 4.1d1 (Parser Generator)
(type "javacc" with no arguments for help)
Warning: Bad option "-deprecation" will be ignored.
Warning: Bad option "-g" will be ignored.
Warning: Bad option "-Xstdout" will be ignored.
Argument "+T4" must be an option setting.
Compile Failed (1)
The man pages of javacc says for example: javacc -STATIC=false -LOOKAHEAD:2 -debug_parser mygrammar.jj and this is what I type in the second line.
Then I get the following error message:
Compiling...
Java Compiler Compiler Version 4.1d1 (Parser Generator)
(type "javacc" with no arguments for help)
Argument "javacc" must be an option setting.
Compile Failed (1)
So, I think I cant handle the javacc option. Can someone please post his compiler preferences (all three lines please) of javacc under ubuntu.
Thanks,
denke
When you see the compiler error like for the BulletHitBulletEvent class, then you are using Jikes for compiling, and hence it also complaints about the javac options, which does not match Jikes options. So you need to shift to the javac, and I will help you with exactly that.
I have reproduced your scenario under Ubuntu 9.04, and the reason why Robocode does not "see" javac, so it defaults to Jikes must be that you have not installed the proper JDK package.
What you need to do is:
1) Check if you have javac installed. In a terminale, you should write this in your terminale:
javac
If it writes out "The program 'javac' can be found in the following packages:", you need to install either sun-java5-jdk or sun-java6-jdk. You should use sun-java5-jdk if you want to be on the safe side. Now write this in your terminale:
sudo apt-get install sun-java5-jdk
When this is done you have installed Sun's JDK 5 which includes the javac compiler.
2) If you already had the JDK installed or you have just installed it, you should not write the following in your terminale:
sudo update-alternatives --config javac
Now select the version you want, e.g. the one for "/usr/lib/jvm/java-1.5.0-sun/bin/javac" if you install the sun-java5-jdk.
3) Finally, write this into the terminale:
javac -version
It should now write out information about which version of javac you are using. :-)
Now restart Robocode, and start the Robot Editor (Robot -> Editor). Robocode might give a dialog saying that it found javac and ask you if you want to use it? If so, press "Yes" and you will be using javac. If not, then reset the compiler in the Robot Editor (Compiler -> Options -> Reset Compiler). Now it should be able to locate javac, and it will automatically change the settings for you.
I really hope this helps! :-)