AIInterface:Java: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 12: | Line 12: | ||
For reference only: '''[[AI:JAI|JAI]]''' (DEPRECATED) | For reference only: '''[[AI:JAI|JAI]]''' (DEPRECATED) | ||
=== | === AIs using it === | ||
(as of January 2009) | (as of January 2009) | ||
Skirmish AIs: | Skirmish AIs: | ||
* '''[[AI:NullJavaAI|NullJavaAI]]'''<br> | * '''[[AI:NullJavaAI|NullJavaAI]]'''<br> | ||
* '''[[AI:NullOOJavaAI|NullOOJavaAI]]''' | * '''[[AI:NullOOJavaAI|NullOOJavaAI]]''' | ||
=== Download === | |||
It comes with spring current dev version (GIT branch ''caiinterface''). | |||
=== Supported Platforms === | === Supported Platforms === | ||
| Line 39: | Line 42: | ||
=== How to compile === | === How to compile === | ||
'''The easy way''' | '''The easy way'''<br> | ||
Use Scons or CMake (refer to [[Building_spring|Building spring]]). | Use Scons or CMake (refer to [[Building_spring|Building spring]]). | ||
Revision as of 15:47, 14 January 2009
| Developer | |
| Version | |
| Language Support | |
| Status | |
| License | |
Forum threads
Description
This AI interface is written in C, Java and AWK, and heavily relies on JNI and JNA. It allows spring to load AIs written in Java. These AIs consist of a .jar file, which contains at least one class that implements the interface (see {spring_source}/AI/Interfaces/Java/java/src/com/clan_sy/spring/ai/AI.java).
The source of this AI interface library can be found here: {spring_source}/AI/Interfaces/Java/. It is only available in the caiinterface branch of the spring repository directory at the moment.
For reference only: JAI (DEPRECATED)
AIs using it
(as of January 2009) Skirmish AIs:
Download
It comes with spring current dev version (GIT branch caiinterface).
Supported Platforms
As this interface uses JNA, it is limited to the platforms where it is available: (as of Jan 2009)
- Windows (x86/amd64)
- Linux (i386/amd64)
- OS X (ppc/i386/amd64)
- FreeBSD (i386/amd64)
- OpenBSD (i386)
- Solaris (x86/amd64/sparc/sparcv9)
As this includes all platforms and architectures that spring currently runs on, this should not cause any problems at all.
Download
It is only available in the caiinterface branch of the spring repository at the moment (January 2009). Refer to Obtaining the Source, and replace master with caiinterface.
It will come with spring soon.
Known Crashes
- None
How to compile
The easy way
Use Scons or CMake (refer to Building spring).
The hard way
C part:
- include directories:
- {spring_source}/rts/ExternalAI/Interface
- {spring_source}/AI/Wrappers/CUtils
- {spring_source}/AI/Interfaces/Java
- source files:
- {spring_source}/AI/Interfaces/Java/*.c*
- create a dynamic loadable shared library (module)
- should compile with all C++ compilers (tested with: MinGW, GCC, Intel)
tested under Linux32 and Win32
Java part:
- Reffer to the shell scripts for your platform: {spring_source}/AI/Interfaces/Java/bin/*.sh|.bat* Refffer to the shell scripts for your
- Or use the ant build script at: {spring_source}/AI/Interfaces/Java/bin/build.xml
How to install/use
Additional software you need to have installed to be able to use Java AIs:
Make sure your Env-Vars are set like this (replace absolute paths):
Windows:
SET JAVA_HOME=C:/Program Files/Java/jre1.6.0_05
SET PATH=%JAVA_HOME%/bin;%JAVA_HOME%/bin/client;%PATH%
Linux:
export JAVA_HOME=/usr/jre1.6.0_10
export PATH=$JAVA_HOME/bin:$JAVA_HOME/bin/client:$PATH
Install the easy way
Use Scons or CMake (refer to Building spring).
... the manual way
from: {spring_source}/AI/Interfaces/Java/
to: {spring_data_dir}/AI/Interfaces/Java/{Java-AIInterface-version}/
- copy lib*.so, lib*.dylib or *.dll to .
- copy data/* to .