diff --git a/Malmo/samples/Java_examples/JavaExamples_run_mission.java b/Malmo/samples/Java_examples/JavaExamples_run_mission.java index 78830f5d5..be2831f6f 100755 --- a/Malmo/samples/Java_examples/JavaExamples_run_mission.java +++ b/Malmo/samples/Java_examples/JavaExamples_run_mission.java @@ -24,6 +24,8 @@ // To run from the jar file without compiling: java -cp MalmoJavaJar.jar:JavaExamples_run_mission.jar -Djava.library.path=. JavaExamples_run_mission (on Linux) // java -cp MalmoJavaJar.jar;JavaExamples_run_mission.jar -Djava.library.path=. JavaExamples_run_mission (on Windows) +import com.microsoft.msr.malmo.*; + public class JavaExamples_run_mission { static diff --git a/Malmo/src/JavaWrapper/CMakeLists.txt b/Malmo/src/JavaWrapper/CMakeLists.txt index 47fccac4b..1050a7bdc 100755 --- a/Malmo/src/JavaWrapper/CMakeLists.txt +++ b/Malmo/src/JavaWrapper/CMakeLists.txt @@ -21,13 +21,15 @@ include( UseJava ) include( UseSWIG ) include_directories( ${JNI_INCLUDE_DIRS} ) -set( CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR} ) - +set( JAVA_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/com/microsoft/msr/malmo ) +set( CMAKE_SWIG_OUTDIR ${JAVA_OUTDIR} ) +set( PACKAGE_NAME com.microsoft.msr.malmo ) # Build the SWIG C++ classes into a .so/.dll module for dynamic loading set_source_files_properties( MalmoJava.i PROPERTIES CPLUSPLUS 1 ) if( ALE_FOUND ) set_source_files_properties( MalmoJava.i PROPERTIES SWIG_FLAGS "-DWRAP_ALE" ) endif() +set( CMAKE_SWIG_FLAGS -package ${PACKAGE_NAME} ) swig_add_module( MalmoJava @@ -39,27 +41,27 @@ install( TARGETS MalmoJava DESTINATION Java_Examples ) # build the SWIG Java files into a .jar set( SWIG_JAVA_SOURCES - ${CMAKE_CURRENT_BINARY_DIR}/AgentHost.java - ${CMAKE_CURRENT_BINARY_DIR}/MalmoJava.java - ${CMAKE_CURRENT_BINARY_DIR}/MalmoJavaJNI.java - ${CMAKE_CURRENT_BINARY_DIR}/ArgumentParser.java - ${CMAKE_CURRENT_BINARY_DIR}/ByteVector.java - ${CMAKE_CURRENT_BINARY_DIR}/ClientInfo.java - ${CMAKE_CURRENT_BINARY_DIR}/ClientPool.java - ${CMAKE_CURRENT_BINARY_DIR}/MissionRecordSpec.java - ${CMAKE_CURRENT_BINARY_DIR}/MissionSpec.java - ${CMAKE_CURRENT_BINARY_DIR}/ParameterSet.java - ${CMAKE_CURRENT_BINARY_DIR}/TimestampedReward.java - ${CMAKE_CURRENT_BINARY_DIR}/TimestampedRewardVector.java - ${CMAKE_CURRENT_BINARY_DIR}/TimestampedString.java - ${CMAKE_CURRENT_BINARY_DIR}/TimestampedStringVector.java - ${CMAKE_CURRENT_BINARY_DIR}/TimestampedUnsignedCharVector.java - ${CMAKE_CURRENT_BINARY_DIR}/TimestampedVideoFrame.java - ${CMAKE_CURRENT_BINARY_DIR}/TimestampedVideoFrameVector.java - ${CMAKE_CURRENT_BINARY_DIR}/WorldState.java + ${JAVA_OUTDIR}/AgentHost.java + ${JAVA_OUTDIR}/MalmoJava.java + ${JAVA_OUTDIR}/MalmoJavaJNI.java + ${JAVA_OUTDIR}/ArgumentParser.java + ${JAVA_OUTDIR}/ByteVector.java + ${JAVA_OUTDIR}/ClientInfo.java + ${JAVA_OUTDIR}/ClientPool.java + ${JAVA_OUTDIR}/MissionRecordSpec.java + ${JAVA_OUTDIR}/MissionSpec.java + ${JAVA_OUTDIR}/ParameterSet.java + ${JAVA_OUTDIR}/TimestampedReward.java + ${JAVA_OUTDIR}/TimestampedRewardVector.java + ${JAVA_OUTDIR}/TimestampedString.java + ${JAVA_OUTDIR}/TimestampedStringVector.java + ${JAVA_OUTDIR}/TimestampedUnsignedCharVector.java + ${JAVA_OUTDIR}/TimestampedVideoFrame.java + ${JAVA_OUTDIR}/TimestampedVideoFrameVector.java + ${JAVA_OUTDIR}/WorldState.java ) if ( ALE_FOUND ) - set( SWIG_JAVA_SOURCES ${SWIG_JAVA_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/ALEAgentHost.java ) + set( SWIG_JAVA_SOURCES ${SWIG_JAVA_SOURCES} ${JAVA_OUTDIR}/ALEAgentHost.java ) endif() add_jar( diff --git a/Malmo/test/JavaTests/test_ALE_built.java b/Malmo/test/JavaTests/test_ALE_built.java index 42c665838..78dbf7e0e 100755 --- a/Malmo/test/JavaTests/test_ALE_built.java +++ b/Malmo/test/JavaTests/test_ALE_built.java @@ -17,6 +17,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -------------------------------------------------------------------------------------------------- +import com.microsoft.msr.malmo.*; + public class test_ALE_built { static diff --git a/Malmo/test/JavaTests/test_agent_host.java b/Malmo/test/JavaTests/test_agent_host.java index 5d5415e78..abcaef285 100755 --- a/Malmo/test/JavaTests/test_agent_host.java +++ b/Malmo/test/JavaTests/test_agent_host.java @@ -17,6 +17,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -------------------------------------------------------------------------------------------------- +import com.microsoft.msr.malmo.*; + public class test_agent_host { static diff --git a/Malmo/test/JavaTests/test_argument_parser.java b/Malmo/test/JavaTests/test_argument_parser.java index 27c716760..2277726c0 100755 --- a/Malmo/test/JavaTests/test_argument_parser.java +++ b/Malmo/test/JavaTests/test_argument_parser.java @@ -17,6 +17,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -------------------------------------------------------------------------------------------------- +import com.microsoft.msr.malmo.*; + public class test_argument_parser { static diff --git a/Malmo/test/JavaTests/test_mission.java b/Malmo/test/JavaTests/test_mission.java index 46a35f4ee..69f2bbe37 100755 --- a/Malmo/test/JavaTests/test_mission.java +++ b/Malmo/test/JavaTests/test_mission.java @@ -17,6 +17,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -------------------------------------------------------------------------------------------------- +import com.microsoft.msr.malmo.*; + public class test_mission { static diff --git a/Malmo/test/JavaTests/test_parameter_set.java b/Malmo/test/JavaTests/test_parameter_set.java index 4d7418118..b8e9f8f7f 100755 --- a/Malmo/test/JavaTests/test_parameter_set.java +++ b/Malmo/test/JavaTests/test_parameter_set.java @@ -17,6 +17,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -------------------------------------------------------------------------------------------------- +import com.microsoft.msr.malmo.*; + public class test_parameter_set { static diff --git a/Malmo/test/JavaTests/test_wrapping.java b/Malmo/test/JavaTests/test_wrapping.java index 3190a9c11..53fc1355f 100755 --- a/Malmo/test/JavaTests/test_wrapping.java +++ b/Malmo/test/JavaTests/test_wrapping.java @@ -17,6 +17,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -------------------------------------------------------------------------------------------------- +import com.microsoft.msr.malmo.*; + public class test_wrapping { static