I'm using a 2010 13inch macbook pro running snow leopard 10.6.8, and I do believe the native java compiler for robocode. Whenever I try to save a robot that I have created, I get the following:
Compiling...
javac: invalid flag: 1/robocode/robots"
Usage: javac <options>
use -help for a list of possible options
Compile Failed (2)
---- Codesize ----
Codesize: 0 bytes
Robot weight class: NanoBot (codesize < 250 bytes)
I have found no help anywhere, as no one else seems to have this problem. I don't really understand what it is telling me. Perhaps it is because it is running on Snow Leopard, as the compiler works fine on my friends laptop, running lion or mountain lion, whichever. Also, robocode was just updated to the newest version, still doesn't work.
I would appreciate any help possible. However, I am not willing to upgrade to the new operating system, unless that is the ONLY way. I run too many partitions and bootcamp to risk screwing with an upgrade right now.
Anonymous
I haven't seen this problem before. First of all you could try to reset your compiler in Robocode from the menu: Robot -> Editor, Compiler -> Options -> Reset Compiler.
Robocode will try to find a suitable compiler on your system. If it find a "wrong" one or a compiler that is not Hotspot compatible, then it will use the ECJ that is built into Robocode. Try to swicth between these. Also check the compiler options (Compiler -> Options -> Preferences) to see if things looks okay or needs to be adjusted.
Second attachment
Guess my earlier comment didn't post. I tried reseting the compiler and using the default it didn't work. I have attached a photo with the compiler preferences as well. I think it is a problem with the Classpath. The above photo is of what happens when I try to save a file. There are 2 "//" in where it wants me to save it, which is bad.
This is looking really strange to me. The compiler save path writes:
/Users/ian 1/robocode/robots/Users/ian 1/robocode/robots/ir/Paladin.java
It annoys me that is writes this twice in the path:
/Users/ian 1/robocode/robots/
Do you have any idea why this happens?
I should like you to move Robocode to e.g. /robocode, so your robot home path would be /robocode/robots. I am not sure it is a good idea to have white-spaces in the path name. Robocode / Java should be able to handle it, but there might be a bug somewhere. At least, we need to find out where the problem lies. At least it is not the compiler, but the way Robocode assembled the file path for the robot.
I need a way to reproduce this scenario, e.g. under Mac OS X or Linux.
So you have installed Robocode under '/Users/ian 1/robocode', I guess. This is weird, as Robocode wants to install your robot under ...//Users/ian/Paladin.java. So it seems you have two user names. One that is 'ian 1', and another which is 'ian'?
Did you create your Paladin robot under the package name 'ir'?
Yea, It asked me to create one using my two initials. I don't know where the ian came from. ian1 is my home directory. The ian is stored in the same folder as the ir, even though there are several instances of both. I could try deleting the ian and seeing what happens. Alternatively, I could wipe all of the robocode files and try a clean install to see if I can get rid of the ian. I haven't been able to make anything, so I wouldn't lose anything. However, I don't know if that would fix the problem.
You could try to install Robocode somewhere else. It is simple to delete, as you just delete the 'robocode' directory with all sub directories. I would try installing at your root. E.g. /robocode, just to try it out. If it works, you could just move the directory to somewhere else and try again.
Tell me if this works out for you. :-)
That did it. Thank you very much. I think that it was definitely some kind of pathing error for saving, cause now it saves to "/Robocode/robots/ir" perfectly, none of this other crud. Not sure how saving it at the root would effect it, but it works now. Now I just have to figure how to actually use code XD
Thanks again, so much.
You are welcome. I am happy to hear that it is finally up and running.
You could try to make a copy of your robocode installation to your preferred directory under your user account and start Robocode up there and see if it works. It could be some problems with the file path for the user profile somehow, which I cannot figure out.
Regarding finding out how to code. Take a look at the RoboWiki. It provides lots of information and lots of Robocoders that can help you out getting started etc. :-)