AIInterface:Java: Difference between revisions
New page: {{AIInterface|Java|hoijui|v0.1 (spring SVN)|Java|pre alpha|GNU GPL v2+}} === Forum threads === *[http://spring.clan-sy.com/phpbb/viewtopic.php?f=15&t=12308 Java AI Interface for Spring] *... |
No edit summary |
||
| Line 1: | Line 1: | ||
{{AIInterface|Java|hoijui| | {{AIInterface|Java|hoijui|0.1 (spring SVN)|Java|pre alpha|GNU GPL v2+}} | ||
=== Forum threads === | === Forum threads === | ||
| Line 6: | Line 6: | ||
=== Description === | === 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 hte caiinterface branch of the spring SNV directory at the moment. | |||
The source of this AI interface library can be found here: ''{spring_source}/AI/Interfaces/Java/'' | |||
For reference only: '''[[AI:JAI|JAI]]''' (DEPRECATED) | For reference only: '''[[AI:JAI|JAI]]''' (DEPRECATED) | ||
=== Currently supported AIs === | === Currently supported AIs === | ||
* '''[[AI: | * '''[[AI:NullJavaAI|NullJavaAI]]'''<br><br> | ||
* '''[[AI:NullOOJavaAI|NullOOJavaAI]]''' | |||
=== Download === | === Download === | ||
It is only available in hte caiinterface branch of the spring SNV directory at the moment. | |||
It will come with spring | It will come with spring soon. | ||
=== Known Crashes === | === Known Crashes === | ||
*None | * None | ||
=== How to compile === | === How to compile === | ||
====The easy way==== | |||
Use Scons or CMake (refer to [[Building_spring|Building spring]]). | |||
====The hard way==== | |||
C part: | C part: | ||
* include directories: ''{spring_source}/rts/System {spring_source}/AI/Interfaces/Java'' | * include directories: ''{spring_source}/rts/System {spring_source}/AI/Interfaces/Java'' | ||
* source files: ''{spring_source}/AI/Interfaces/ | * source files: ''{spring_source}/AI/Interfaces/Java/*.c*'' | ||
* create dynamic loadable shared library (module) | * create a dynamic loadable shared library (module) | ||
* should compile with all C++ compilers | * should compile with all C++ compilers (tested with: MinGW, GCC, Intel) | ||
teted under Linux and Win32 | |||
Java part: | Java part: | ||
| Line 39: | Line 43: | ||
* [http://www.java.com/de/download/ Java Runtime Environment v1.5.0+ (tested with 1.6.0)] | * [http://www.java.com/de/download/ Java Runtime Environment v1.5.0+ (tested with 1.6.0)] | ||
====The easy way==== | |||
Use Scons or CMake (refer to [[Building_spring|Building spring]]). | |||
====The hard way==== | |||
from source at ''{spring_source}/AI/Interfaces/Java/'' : | from source at ''{spring_source}/AI/Interfaces/Java/'' : | ||
* copy libJava-0.1.so, libJava-0.1.dylib or libJava-0.1.dll to ''{spring_data_dir}/AI/Interfaces/impls/'' | * copy libJava-0.1.so, libJava-0.1.dylib or libJava-0.1.dll to ''{spring_data_dir}/AI/Interfaces/impls/'' | ||
| Line 53: | Line 61: | ||
On Linux:<br> | On Linux:<br> | ||
<code> | <code> | ||
export JAVA_HOME=/usr/jre1.6. | export JAVA_HOME=/usr/jre1.6.0_10<br> | ||
export PATH=$JAVA_HOME/bin:$JAVA_HOME/bin/client:$PATH | export PATH=$JAVA_HOME/bin:$JAVA_HOME/bin/client:$PATH | ||
</code> | </code> | ||
Revision as of 20:46, 19 December 2008
| 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 hte caiinterface branch of the spring SNV directory at the moment.
For reference only: JAI (DEPRECATED)
Currently supported AIs
Download
It is only available in hte caiinterface branch of the spring SNV directory at the moment.
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/System {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)
teted under Linux and Win32
Java part: TODO
How to install/use
Additional software you need to have installed to be able to use Java AIs:
The easy way
Use Scons or CMake (refer to Building spring).
The hard way
from source at {spring_source}/AI/Interfaces/Java/ :
- copy libJava-0.1.so, libJava-0.1.dylib or libJava-0.1.dll to {spring_data_dir}/AI/Interfaces/impls/
- copy InterfaceInfo.lua to {spring_data_dir}/AI/Interfaces/data/Java-0.1/
Make sure your Env-Vars are set like this (replace absolute paths):
On Windows:
SET JAVA_HOME=C:/Program Files/Java/jre1.6.0_05
SET PATH=%JAVA_HOME%/bin;%JAVA_HOME%/bin/client;%PATH%
On Linux:
export JAVA_HOME=/usr/jre1.6.0_10
export PATH=$JAVA_HOME/bin:$JAVA_HOME/bin/client:$PATH