<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=AIInterface%3AJava</id>
	<title>AIInterface:Java - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=AIInterface%3AJava"/>
	<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=AIInterface:Java&amp;action=history"/>
	<updated>2026-04-21T02:04:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=AIInterface:Java&amp;diff=2424&amp;oldid=prev</id>
		<title>Qrow: Created page with &quot;{{AIInterface|Java|hoijui|0.1|[http://en.wikipedia.org/wiki/Java_Virtual_Machine JVM languages]|~stable|GNU GPL v2+}}  == Java AI Interface Wrapper ==  ==== Forum threads ==== *[http://spring.clan-sy.com/phpbb/viewtopic.php?f=15&amp;t=12308 Java AI Interface for Spring] *[http://spring.clan-sy.com/phpbb/viewtopic.php?f=15&amp;t=15019 AI Interface redesign (in C)]  ==== Description ==== This AI Interface is written in C, Java and AWK, and heavily relies on JNI and JNA. It allows...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=AIInterface:Java&amp;diff=2424&amp;oldid=prev"/>
		<updated>2026-03-04T00:13:01Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{AIInterface|Java|hoijui|0.1|[http://en.wikipedia.org/wiki/Java_Virtual_Machine JVM languages]|~stable|GNU GPL v2+}}  == Java AI Interface Wrapper ==  ==== Forum threads ==== *[http://spring.clan-sy.com/phpbb/viewtopic.php?f=15&amp;amp;t=12308 Java AI Interface for Spring] *[http://spring.clan-sy.com/phpbb/viewtopic.php?f=15&amp;amp;t=15019 AI Interface redesign (in C)]  ==== Description ==== This AI Interface is written in C, Java and AWK, and heavily relies on JNI and JNA. It allows...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{AIInterface|Java|hoijui|0.1|[http://en.wikipedia.org/wiki/Java_Virtual_Machine JVM languages]|~stable|GNU GPL v2+}}&lt;br /&gt;
&lt;br /&gt;
== Java AI Interface Wrapper ==&lt;br /&gt;
&lt;br /&gt;
==== Forum threads ====&lt;br /&gt;
*[http://spring.clan-sy.com/phpbb/viewtopic.php?f=15&amp;amp;t=12308 Java AI Interface for Spring]&lt;br /&gt;
*[http://spring.clan-sy.com/phpbb/viewtopic.php?f=15&amp;amp;t=15019 AI Interface redesign (in C)]&lt;br /&gt;
&lt;br /&gt;
==== Description ====&lt;br /&gt;
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, or any of the other [http://en.wikipedia.org/wiki/Java_Virtual_Machine languages supported by the JVM] like [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java], [http://en.wikipedia.org/wiki/Groovy_%28programming_language%29 Groovy], [http://en.wikipedia.org/wiki/JRuby JRuby], [http://en.wikipedia.org/wiki/Jython Jython], [http://en.wikipedia.org/wiki/Scala_%28programming_language%29 Scala] or [http://en.wikipedia.org/wiki/Clojure Clojure]. These AIs consist of a &amp;#039;&amp;#039;.jar&amp;#039;&amp;#039; file, which contains at least one class that implements the interface (see &amp;#039;&amp;#039;{spring_source}/AI/Interfaces/Java/java/src/com/springrts/ai/AI.java&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
For reference only: &amp;#039;&amp;#039;&amp;#039;[[AI:JAI|JAI]]&amp;#039;&amp;#039;&amp;#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;DEPRECATED&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== AIs using it ====&lt;br /&gt;
(as of January 2009)&lt;br /&gt;
&lt;br /&gt;
Skirmish AIs:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[AI:NullJavaAI|NullJavaAI]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[AI:NullOOJavaAI|NullOOJavaAI]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Supported Platforms ====&lt;br /&gt;
As this interface uses JNA, it is limited to the platforms where it is available:&lt;br /&gt;
(as of Jan 2009)&lt;br /&gt;
* Windows	(x86/amd64)&lt;br /&gt;
* Linux		(i386/amd64)&lt;br /&gt;
* OS X		(ppc/i386/amd64)&lt;br /&gt;
* FreeBSD	(i386/amd64)&lt;br /&gt;
* OpenBSD	(i386)&lt;br /&gt;
* Solaris	(x86/amd64/sparc/sparcv9)&lt;br /&gt;
As this includes all platforms and architectures that spring currently runs on,&lt;br /&gt;
this should not cause any problems at all.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
It comes with a spring default install.&lt;br /&gt;
&lt;br /&gt;
==== Source ====&lt;br /&gt;
The source can be found under &amp;#039;&amp;#039;{spring_source}/AI/Interface/Java/&amp;#039;&amp;#039;.&lt;br /&gt;
Not all the Java source files are available under this directory,&lt;br /&gt;
as a big part of them are generated during the build process, and are therefore only available when you generate them yourself, or in the AIInterface-src.jar in&lt;br /&gt;
your spring installation.&lt;br /&gt;
&lt;br /&gt;
==== Bugs ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Known Crashes:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* When natively debugging (eg with GDB), you may get random &amp;#039;&amp;#039;SIGSEGV&amp;#039;&amp;#039;s/&amp;#039;&amp;#039;segmentation fault&amp;#039;&amp;#039;s when using Java AIs. This is due to the JVM using &amp;#039;&amp;#039;SIGSEGV&amp;#039;&amp;#039; as a signal for garbage collection. There are two workarounds:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;recommended&amp;#039;&amp;#039;&amp;#039;: issue a &amp;#039;&amp;#039;continue&amp;#039;&amp;#039; in your native debugger; if spring continues normally, it was a JVM garbage collection &amp;#039;&amp;#039;SIGSEGV&amp;#039;&amp;#039;&lt;br /&gt;
** use the JVM without JIT (Just In Time compilation), as the JVM does not use &amp;#039;&amp;#039;SIGSEGVs&amp;#039;&amp;#039; in this mode. This will make cause additional run-time CPU usage.&lt;br /&gt;
&lt;br /&gt;
Please report bugs under&lt;br /&gt;
[http://springrts.com/mantis/ Mantis]&lt;br /&gt;
to the AI sub-project.&lt;br /&gt;
&lt;br /&gt;
==== How to compile ====&lt;br /&gt;
Make sure your Env-Vars are set like this (replace absolute paths according to your system):&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Windows:&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SET JAVA_HOME=C:/Program Files/Java/jdk1.6.0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Linux:&amp;#039;&amp;#039; (you may want to place this in your &amp;#039;&amp;#039;~/.profile&amp;#039;&amp;#039; file)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
export JAVA_HOME=/usr/jdk1.6.0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The easy way&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Use Scons or CMake (refer to [[Building_spring|Building spring]]).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The hard way&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;C part:&amp;#039;&amp;#039;&lt;br /&gt;
* include directories:&lt;br /&gt;
** {spring_source}/rts/ExternalAI/Interface&lt;br /&gt;
** {spring_source}/AI/Wrappers/CUtils&lt;br /&gt;
** {spring_source}/AI/Interfaces/Java&lt;br /&gt;
* source files:&lt;br /&gt;
** {spring_source}/AI/Interfaces/Java/*.c*&lt;br /&gt;
* create a dynamic loadable shared library (module)&lt;br /&gt;
* should compile with all C++ compilers (tested with: MinGW, GCC, Intel)&lt;br /&gt;
tested under Linux32 and Win32&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Java part:&amp;#039;&amp;#039;&lt;br /&gt;
* Reffer to the shell scripts for your platform: &amp;#039;&amp;#039;{spring_source}/AI/Interfaces/Java/bin/*.sh|.bat&amp;#039;&amp;#039;* Refffer to the shell scripts for your &lt;br /&gt;
* Or use the ant build script at: &amp;#039;&amp;#039;{spring_source}/AI/Interfaces/Java/bin/build.xml&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== How to install/use ====&lt;br /&gt;
Additional software you need to have installed to be able to use Java AIs:&lt;br /&gt;
* [http://www.java.com/de/download/ Java Runtime Environment v1.5.0+ (tested with 1.6.0)]&lt;br /&gt;
&lt;br /&gt;
Make sure your Env-Vars are set like this (replace absolute paths according to your system):&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Windows:&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SET JAVA_HOME=C:/Program Files/Java/jre1.6.0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Linux:&amp;#039;&amp;#039; (you may want to place this in your &amp;#039;&amp;#039;~/.profile&amp;#039;&amp;#039; file)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
export JAVA_HOME=/usr/jre1.6.0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Install the easy way&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Use Scons or CMake (refer to [[Building_spring|Building spring]]).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; ... the manual way&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
from: &amp;#039;&amp;#039;{spring_source}/AI/Interfaces/Java/&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
to: &amp;#039;&amp;#039;{spring_data_dir}/AI/Interfaces/Java/{Java-AIInterface-version}/&amp;#039;&amp;#039;&lt;br /&gt;
* copy &amp;#039;&amp;#039;lib*.so&amp;#039;&amp;#039;, &amp;#039;&amp;#039;lib*.dylib&amp;#039;&amp;#039; or &amp;#039;&amp;#039;*.dll&amp;#039;&amp;#039; to &amp;#039;&amp;#039;./&amp;#039;&amp;#039;&lt;br /&gt;
* copy &amp;#039;&amp;#039;data/*&amp;#039;&amp;#039; to &amp;#039;&amp;#039;./&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; [[AIs|&amp;lt;- Back to AI page]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Category: AIInterface]]&lt;/div&gt;</summary>
		<author><name>Qrow</name></author>
	</entry>
</feed>