Java AI: Classpath setup

Java AI: Classpath setup

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

Java AI: Classpath setup

Post 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:
    EDIT: the command class is outdated and not included in the current oo wrapper. Commands are now given via the unit class. See: http://spring.abma.de/doc-Interface-Jav ... /Unit.html
    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
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Java AI: Classpath setup

Post 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!
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

Re: Java AI: Classpath setup

Post 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).
Bla
Posts: 79
Joined: 25 Feb 2013, 14:44

Re: Java AI: Classpath setup

Post 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.
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

Re: Java AI: Classpath setup

Post 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.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Java AI: Classpath setup

Post by gajop »

gajop wrote:the ones in my link are really outdated.
Please keep that in mind!
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

Re: Java AI: Classpath setup

Post by meriton »

I will, but they are all I have (as posted above I don't know where I can get a current version) ...
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Java AI: Classpath setup

Post 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.
Bla
Posts: 79
Joined: 25 Feb 2013, 14:44

Re: Java AI: Classpath setup

Post 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
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

Re: Java AI: Classpath setup

Post 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.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Java AI: Classpath setup

Post 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
Post Reply

Return to “AI”