Difference between revisions of "Talk:Robocode/My First Robot"

From Robowiki
Jump to navigation Jump to search
m (fixed text on link)
(→‎HELP!: * wildcard)
Line 21: Line 21:
  
 
Yes [[User:Rednaxela|Rednaxela]], you are right that for compilation there is no point to include any jar that is not robocode.jar. I didn't know that the * wildcard worked but is good to know [[User:Nat|Nat]]. But all my disinformation comes from Eclipse, I added the 4 jars there and he knows what to use :-). --[[User:Zyx|zyx]] 19:44, 11 March 2009 (UTC)
 
Yes [[User:Rednaxela|Rednaxela]], you are right that for compilation there is no point to include any jar that is not robocode.jar. I didn't know that the * wildcard worked but is good to know [[User:Nat|Nat]]. But all my disinformation comes from Eclipse, I added the 4 jars there and he knows what to use :-). --[[User:Zyx|zyx]] 19:44, 11 March 2009 (UTC)
 +
 +
I don't think the * will work for .jar files. It works for .class files only. Well, that was my experience several years ago, when I last used Windows. --[[User:Skilgannon|Skilgannon]] 19:49, 11 March 2009 (UTC)

Revision as of 20:49, 11 March 2009

HELP!

I am an experienced 13 year old Java programmer, and I decided to try this, (it looks VERY cool) but when I try to compile the simple default program it gives many errors. I figured out pretty quickly; it can't find the robocode package. I need to like set the classpath, but I can't directly do this. >=( Robocode SHOULD do this on its own...

Robocode can't simply do everything for you, becasuse it is a Java setting issue, if you are using Eclipse you can set it trough the Build Path Settings, on the Libraries tab, select Add External Jars, search for your Robocode instalation directory (default in Windows is C:\robocode) under that directory there should be a libs directory, there are four jars, you might not need all of them, but I recommend you add all of them for now.

If you are compiling from the console you should do something like

javac -cp C:\robocode\libs\cachecleaner.jar;C:\robocode\libs\codesize.jar;C:\robocode\libs\robocode.jar;C:\robocode\libs\roborumble.jar ...

To set the classpath, but I really recommend using an advanced IDE like Eclipse (or whatever you prefer, ie. NetBeans). Hope it helps, and welcome to Robocode. --zyx 08:55, 11 March 2009 (UTC)

Actually Zyx, you don't need the cachecleaner, codesize or roborumble jars ofr compiling bots. --Rednaxela 12:44, 11 March 2009 (UTC)

Maybe this is easier?

javac -cp C:\robocode\libs\*; ...

it load every library in /libs automatically. (ripped from Robocode 1.7 startup files) » Nat | Talk » 13:14, 11 March 2009 (UTC)

Yes Rednaxela, you are right that for compilation there is no point to include any jar that is not robocode.jar. I didn't know that the * wildcard worked but is good to know Nat. But all my disinformation comes from Eclipse, I added the 4 jars there and he knows what to use :-). --zyx 19:44, 11 March 2009 (UTC)

I don't think the * will work for .jar files. It works for .class files only. Well, that was my experience several years ago, when I last used Windows. --Skilgannon 19:49, 11 March 2009 (UTC)