diff --git a/Modules/IO/TestKernel/src/otbTestDriver.cxx b/Modules/IO/TestKernel/src/otbTestDriver.cxx
index d6995082c653e942337053ed7ca7bb74c1ac351c..4fbeeb755b34d97d8eff4a2887e1fbccc87721b8 100644
--- a/Modules/IO/TestKernel/src/otbTestDriver.cxx
+++ b/Modules/IO/TestKernel/src/otbTestDriver.cxx
@@ -179,7 +179,7 @@ int main(int ac, char* av[])
   argv[remainingArgs.size() + 1] = NULL;
 
   /** Call to the otbTestMain */
-  return otbTestMain(remainingArgs.size(), argv);
+  return otbTestMain(static_cast<int>(remainingArgs.size()), argv);
 
 }
 
diff --git a/Modules/Wrappers/SWIG/src/CMakeLists.txt b/Modules/Wrappers/SWIG/src/CMakeLists.txt
index 5db0b19b314eda4d454952d2663527c56c62cf5c..af424622ef8ff03ed7f4b925190781038ca03552 100644
--- a/Modules/Wrappers/SWIG/src/CMakeLists.txt
+++ b/Modules/Wrappers/SWIG/src/CMakeLists.txt
@@ -84,7 +84,12 @@ if ( OTB_WRAP_JAVA )
        OTBApplicationEngine)
   SWIG_add_module ( otbApplicationJava java otbApplication.i otbApplicationJAVA_wrap.cxx)
   SWIG_link_libraries(otbApplicationJava OTBApplicationEngine )
-  set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/otbApplicationJAVA_wrap.cxx COMPILE_FLAGS "-w")
+  
+  if(MSVC)
+    set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/otbApplicationJAVA_wrap.cxx COMPILE_FLAGS "/wd4005" )
+  else()
+    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/otbApplicationJAVA_wrap.cxx COMPILE_FLAGS "-w")
+  endif()
 
   # Add target for org.otb.Application.jar
   add_custom_target(org_otb_Application_jar ALL DEPENDS org.otb.application.jar)