Page 1 of 1
Java AI: Classpath setup
Posted: 18 May 2014, 15:47
by meriton
Hi folks,
Which JARs do I need to my classpath to develop a Java AI? I checked the instructions at
http://springrts.com/wiki/AI:Development:Lang:Java, but they appear to be outdated:
- According to the docs, I should be adding Spring/AI/Interfaces/Java/[version]/jlib/vecmath.jar to the classpath, but this file doesn't exist in Spring 0.96.0?
- The docs write:
Ok, but how do I get the JAR file containing this class? There is no such JAR file in Spring/AI/Interfaces/Java/[version], is there?
Regards
meriton
Re: Java AI: Classpath setup
Posted: 18 May 2014, 16:12
by gajop
These:
https://github.com/gajop/MyAI/tree/master/lib . However the ones in my link are really outdated. Try to get them from the statically compiled builds of spring:
http://springrts.com/dl/buildbot/default/master/96.0/
(example:
http://springrts.com/dl/buildbot/defaul ... ortable.7z ).
Also read this:
http://springrts.com/phpbb/viewtopic.php?f=15&t=32137
And please, if you find the solution update the guide!
Re: Java AI: Classpath setup
Posted: 18 May 2014, 17:55
by meriton
That Spring build is the same I have installed, and yes, the JAR files are identical.
I have been poking around the Git repository, and found the
makefile that generates JavaOO-AIWrapper.jar . It appears the JAR file is installed into a local maven repository, from where the
ConfigureJavaSkirmishAI macro copies them to into the jlib directory of the Java Skirmish AIs delivered with Spring, where I indeed find:
- vecmath.jar
- vecmath-src.jar
- JavaOO-AIWrapper.jar
I am still missing JavaOO-AIWrapper-src.jar, though (I know it's not needed at runtime, but a source attachment would permit eclipse to display Javadoc tooltips).
Re: Java AI: Classpath setup
Posted: 18 May 2014, 18:22
by Bla
I was the one who wrote the classes are outdated :S
I just extracted the files from nulloojavaai, as it has all the required jars.
Re: Java AI: Classpath setup
Posted: 18 May 2014, 20:35
by meriton
Ok, I'll be using the source attachment from gajop's Git repo, then.
I have updated the wiki page with how to get the other jars.
Re: Java AI: Classpath setup
Posted: 18 May 2014, 20:48
by gajop
gajop wrote:the ones in my link are really outdated.
Please keep that in mind!
Re: Java AI: Classpath setup
Posted: 18 May 2014, 23:10
by meriton
I will, but they are all I have (as posted above I don't know where I can get a current version) ...
Re: Java AI: Classpath setup
Posted: 19 May 2014, 00:21
by gajop
I'm afraid you'll have to compile Spring for the wrapper source. Interface is available in "/AI/Interfaces/Java/0.1/jlib/" though.
Re: Java AI: Classpath setup
Posted: 19 May 2014, 00:25
by Bla
gajop wrote:gajop wrote:the ones in my link are really outdated.
Please keep that in mind!
I really recommend you go to spring/AI/Skirmish/NullOOJavaAI/0.1/jlib/javaOO-AIWrapper.jar
If you want to see the implementation, I guess you could always use jd-gui to decompile it (which is what I did)
Edit: You will also need AI/Interfaces/Java.0.1/jlib/AIInterface-src.jar
so altogether your project will have 2 jar files.
Edit2: Hm, I don't exactly know where javaOO-AIWrapper-src is... and since you seek the documentation, I guess
http://spring.abma.de/doc-Interface-JavaOO/ is your best bet, as that is generated daily based off the documentation in the OO-wrapper
Re: Java AI: Classpath setup
Posted: 19 May 2014, 13:23
by meriton
Hm ... I am somewhat leery of trying to compile Spring. I'm on Windows, and am not really familiar with C++ build tools. Last time I tried to build a C++ open source project, it took me the better part of a day even though they had good documentation. I think that's too much effort just to get the current source for that single JAR. (I'd rather be coding on my AI in that time)
@Bla: I am using the other Jars from the Spring release as you suggest. The Javadoc is nice, but the source is better.
I think my setup works well enough for now, thanks for your help!
I have also updated the wiki page, deleting all that obsolete stuff about commands and factories and describing the new way.
Re: Java AI: Classpath setup
Posted: 19 May 2014, 16:48
by gajop
meriton wrote:I have also updated the wiki page, deleting all that obsolete stuff about commands and factories and describing the new way.
Thanks