Use mingw32 to build the windows launchers. These are useful if the Netbeans platform is used to build 
another application on Debian which you want to be able to run on a Windows system.

--- a/o.n.bootstrap/launcher/windows/Makefile
+++ b/o.n.bootstrap/launcher/windows/Makefile
@@ -15,7 +15,7 @@
 MKDIR=mkdir
 CP=cp
 CCADMIN=CCadmin
-RANLIB=ranlib
+RANLIB=i686-w64-mingw32-ranlib
 
 
 
@@ -26,16 +26,12 @@
 # Add your pre 'build' code here...
 
 .build-post-nbexec: .build-impl nbexecexe.cpp nbexecloader.h utilsfuncs.cpp nbexec_exe.rc
-	windres.exe -Ocoff nbexec_exe.rc nbexec_exe.res
-	g++ -s -mno-cygwin -DNBEXEC_DLL=\"nbexec.dll\" nbexecexe.cpp utilsfuncs.cpp nbexec_exe.res -o nbexec.exe
-	cp nbexec.exe ../../../nbbuild/netbeans/platform/lib/
-	cp nbexec.dll ../../../nbbuild/netbeans/platform/lib/
+	i686-w64-mingw32-windres -Ocoff nbexec_exe.rc nbexec_exe.res
+	i686-w64-mingw32-g++ -s -DNBEXEC_DLL=\"nbexec.dll\" nbexecexe.cpp utilsfuncs.cpp nbexec_exe.res -o nbexec.exe
 	
 .build-post-nbexec64: .build-impl nbexecexe.cpp nbexecloader.h utilsfuncs.cpp nbexec_exe.rc
-	x86_64-w64-mingw32-windres.exe -Ocoff nbexec_exe.rc nbexec_exe64.res 
-	x86_64-w64-mingw32-g++.exe -m64 -s -mno-cygwin -DNBEXEC_DLL=\"nbexec64.dll\" -static-libgcc -static-libstdc++ nbexecexe.cpp utilsfuncs.cpp nbexec_exe64.res -o nbexec64.exe 
-	cp nbexec64.exe ../../../nbbuild/netbeans/platform/lib/
-	cp nbexec64.dll ../../../nbbuild/netbeans/platform/lib/
+	x86_64-w64-mingw32-windres -Ocoff nbexec_exe.rc nbexec_exe64.res 
+	x86_64-w64-mingw32-g++ -m64 -s -DNBEXEC_DLL=\"nbexec64.dll\" -static-libgcc -static-libstdc++ nbexecexe.cpp utilsfuncs.cpp nbexec_exe64.res -o nbexec64.exe 
 
 
 
@@ -46,7 +42,7 @@
 # Add your pre 'clean' code here...
 
 .clean-post-nbexec: .clean-impl
-	rm -f nbexec_exe32.res nbexec32.exe
+	rm -f nbexec_exe.res nbexec.exe
 	
 .clean-post-nbexec64: .clean-impl
 	rm -f nbexec_exe64.res nbexec64.exe
--- a/apisupport.harness/windows-launcher-src/Makefile
+++ b/apisupport.harness/windows-launcher-src/Makefile
@@ -17,7 +17,7 @@
 MKDIR=mkdir
 CP=cp
 CCADMIN=CCadmin
-RANLIB=ranlib
+RANLIB=i686-w64-mingw32-ranlib
 
 
 
@@ -28,10 +28,10 @@
 # Add your pre 'build' code here...
 
 .build-pre-app.exe: app.rc
-	windres -oapp.res -Ocoff app.rc
+	i686-w64-mingw32-windres -oapp.res -Ocoff app.rc
 
 .build-pre-app64.exe: app.rc
-	x86_64-w64-mingw32-windres.exe -oapp64.res -Ocoff app.rc
+	x86_64-w64-mingw32-windres -oapp64.res -Ocoff app.rc
 
 .build-post: .build-impl
 # Add your post 'build' code here...	
@@ -40,6 +40,7 @@
 
 # clean
 clean: .clean-post
+	rm -f app.res app64.res
 
 .clean-pre:
 # Add your pre 'clean' code here...
--- a/o.n.bootstrap/launcher/windows/jvmlauncher.h
+++ b/o.n.bootstrap/launcher/windows/jvmlauncher.h
@@ -50,6 +50,18 @@
 #include <windows.h>
 #include <string>
 #include <list>
+
+// Use the definitions below rather than the linux jdk ones
+#define _JAVASOFT_JNI_MD_H_
+// imports, exports, and calling conventions need to match those used in a dll
+#define JNIEXPORT __declspec(dllexport)
+#define JNIIMPORT __declspec(dllimport)
+#define JNICALL __stdcall
+// Correct types for the windows platform
+typedef long jint;
+typedef __int64 jlong;
+typedef signed char jbyte;
+
 #include "jni.h"
 #include "utilsfuncs.h"
 
--- a/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec.mk
+++ b/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec.mk
@@ -13,12 +13,12 @@
 GREP=grep
 NM=nm
 CCADMIN=CCadmin
-RANLIB=ranlib
-CC=gcc.exe
-CCC=g++.exe
-CXX=g++.exe
-FC=gfortran
-AS=as.exe
+RANLIB=i686-w64-mingw32-ranlib
+CC=
+CCC=i686-w64-mingw32-g++
+CXX=i686-w64-mingw32-g++
+FC=
+AS=i686-w64-mingw32-as
 
 # Macros
 CND_PLATFORM=Cygwin-Windows
@@ -46,8 +46,8 @@
 CFLAGS=
 
 # CC Compiler Flags
-CCFLAGS=-m32 -mno-cygwin
-CXXFLAGS=-m32 -mno-cygwin
+CCFLAGS=-m32
+CXXFLAGS=-m32
 
 # Fortran Compiler Flags
 FFLAGS=
@@ -65,12 +65,12 @@
 nbexec.dll: ${OBJECTDIR}/nbexec.res
 
 nbexec.dll: ${OBJECTFILES}
-	${LINK.cc} -mno-cygwin -shared -o nbexec.dll ${OBJECTFILES} ${LDLIBSOPTIONS} 
+	${LINK.cc} -shared -o nbexec.dll ${OBJECTFILES} ${LDLIBSOPTIONS} 
 
 ${OBJECTDIR}/jvmlauncher.o: jvmlauncher.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/jvmlauncher.o jvmlauncher.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/jvmlauncher.o jvmlauncher.cpp
 
 : nbexec_exe.rc 
 	@echo 
@@ -79,27 +79,27 @@
 ${OBJECTDIR}/nbexec.res: nbexec.rc version.h
 	${MKDIR} -p ${OBJECTDIR}
 	@echo Compiling Resource files...
-	windres.exe -Ocoff nbexec.rc ${OBJECTDIR}/nbexec.res
+	i686-w64-mingw32-windres -Ocoff nbexec.rc ${OBJECTDIR}/nbexec.res
 
 ${OBJECTDIR}/platformlauncher.o: platformlauncher.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/platformlauncher.o platformlauncher.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/platformlauncher.o platformlauncher.cpp
 
 ${OBJECTDIR}/nbexec.o: nbexec.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexec.o nbexec.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexec.o nbexec.cpp
 
 ${OBJECTDIR}/utilsfuncs.o: utilsfuncs.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/utilsfuncs.o utilsfuncs.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/utilsfuncs.o utilsfuncs.cpp
 
 ${OBJECTDIR}/nbexecexe.o: nbexecexe.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexecexe.o nbexecexe.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexecexe.o nbexecexe.cpp
 
 # Subprojects
 .build-subprojects:
--- a/o.n.bootstrap/launcher/windows/utilsfuncs.cpp
+++ b/o.n.bootstrap/launcher/windows/utilsfuncs.cpp
@@ -52,6 +52,7 @@
 #include "argnames.h"
 #include <tlhelp32.h>
 #include <windows.h>
+#include <stdio.h>
 
 using namespace std;
 
--- a/apisupport.harness/windows-launcher-src/nbproject/Makefile-app.exe.mk
+++ b/apisupport.harness/windows-launcher-src/nbproject/Makefile-app.exe.mk
@@ -13,12 +13,12 @@
 GREP=grep
 NM=nm
 CCADMIN=CCadmin
-RANLIB=ranlib
-CC=gcc.exe
-CCC=g++.exe
-CXX=g++.exe
-FC=gfortran
-AS=as.exe
+RANLIB=i686-w64-mingw32-ranlib
+CC=
+CCC=i686-w64-mingw32-g++
+CXX=i686-w64-mingw32-g++
+FC=
+AS=i686-w64-mingw32-as
 
 # Macros
 CND_PLATFORM=Cygwin-Windows
@@ -45,8 +45,8 @@
 CFLAGS=
 
 # CC Compiler Flags
-CCFLAGS=-m32 -mno-cygwin
-CXXFLAGS=-m32 -mno-cygwin
+CCFLAGS=-m32
+CXXFLAGS=-m32
 
 # Fortran Compiler Flags
 FFLAGS=
--- a/ide/launcher/windows/nblauncher.cpp
+++ b/ide/launcher/windows/nblauncher.cpp
@@ -53,6 +53,7 @@
 #include "../../../o.n.bootstrap/launcher/windows/utilsfuncs.h"
 #include "../../../o.n.bootstrap/launcher/windows/argnames.h"
 #include "../../../o.n.bootstrap/launcher/windows/nbexecloader.h"
+#include <stdio.h>
 
 using namespace std;
 
--- a/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec64.mk
+++ b/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec64.mk
@@ -13,12 +13,12 @@
 GREP=grep
 NM=nm
 CCADMIN=CCadmin
-RANLIB=ranlib
-CC=x86_64-w64-mingw32-gcc.exe
-CCC=x86_64-w64-mingw32-g++.exe
-CXX=x86_64-w64-mingw32-g++.exe
-FC=gfortran
-AS=as.exe
+RANLIB=x86_64-w64-mingw32-ranlib
+CC=
+CCC=x86_64-w64-mingw32-g++
+CXX=x86_64-w64-mingw32-g++
+FC=
+AS=x86_64-w64-mingw32-as
 
 # Macros
 CND_PLATFORM=Cygwin64-Windows
@@ -46,8 +46,8 @@
 CFLAGS=
 
 # CC Compiler Flags
-CCFLAGS=-m64 -mno-cygwin -static-libgcc -static-libstdc++
-CXXFLAGS=-m64 -mno-cygwin -static-libgcc -static-libstdc++
+CCFLAGS=-m64 -static-libgcc -static-libstdc++
+CXXFLAGS=-m64 -static-libgcc -static-libstdc++
 
 # Fortran Compiler Flags
 FFLAGS=
@@ -65,12 +65,12 @@
 nbexec64.dll: ${OBJECTDIR}/nbexec64.res
 
 nbexec64.dll: ${OBJECTFILES}
-	${LINK.cc} -mno-cygwin -shared -o nbexec64.dll ${OBJECTFILES} ${LDLIBSOPTIONS} 
+	${LINK.cc} -shared -o nbexec64.dll ${OBJECTFILES} ${LDLIBSOPTIONS} 
 
 ${OBJECTDIR}/jvmlauncher.o: jvmlauncher.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/jvmlauncher.o jvmlauncher.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/jvmlauncher.o jvmlauncher.cpp
 
 : nbexec_exe.rc 
 	@echo 
@@ -79,27 +79,27 @@
 ${OBJECTDIR}/nbexec64.res: nbexec.rc version.h
 	${MKDIR} -p ${OBJECTDIR}
 	@echo Compiling Resource files...
-	x86_64-w64-mingw32-windres.exe -Ocoff nbexec.rc ${OBJECTDIR}/nbexec64.res
+	x86_64-w64-mingw32-windres -Ocoff nbexec.rc ${OBJECTDIR}/nbexec64.res
 
 ${OBJECTDIR}/platformlauncher.o: platformlauncher.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/platformlauncher.o platformlauncher.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/platformlauncher.o platformlauncher.cpp
 
 ${OBJECTDIR}/nbexec.o: nbexec.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexec.o nbexec.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexec.o nbexec.cpp
 
 ${OBJECTDIR}/utilsfuncs.o: utilsfuncs.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/utilsfuncs.o utilsfuncs.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/utilsfuncs.o utilsfuncs.cpp
 
 ${OBJECTDIR}/nbexecexe.o: nbexecexe.cpp 
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} $@.d
-	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include -I/cygdrive/C/Program\ Files/Java/jdk1.7.0_17/include/win32  -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexecexe.o nbexecexe.cpp
+	$(COMPILE.cc) -O2 -s -DNBEXEC_DLL=\"nbexec64.dll\" -I/usr/lib/jvm/default-java/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexecexe.o nbexecexe.cpp
 
 # Subprojects
 .build-subprojects:
--- a/apisupport.harness/windows-launcher-src/nbproject/Makefile-app64.exe.mk
+++ b/apisupport.harness/windows-launcher-src/nbproject/Makefile-app64.exe.mk
@@ -13,12 +13,12 @@
 GREP=grep
 NM=nm
 CCADMIN=CCadmin
-RANLIB=ranlib
-CC=x86_64-w64-mingw32-gcc.exe
-CCC=x86_64-w64-mingw32-g++.exe
-CXX=x86_64-w64-mingw32-g++.exe
-FC=gfortran
-AS=as.exe
+RANLIB=x86_64-w64-mingw32-ranlib
+CC=x86_64-w64-mingw32-gcc
+CCC=x86_64-w64-mingw32-g++
+CXX=x86_64-w64-mingw32-g++
+FC=
+AS=x86_64-w64-mingw32-as
 
 # Macros
 CND_PLATFORM=Cygwin64-Windows
@@ -45,8 +45,8 @@
 CFLAGS=
 
 # CC Compiler Flags
-CCFLAGS=-m64 -mno-cygwin -static-libgcc -static-libstdc++
-CXXFLAGS=-m64 -mno-cygwin -static-libgcc -static-libstdc++
+CCFLAGS=-m64 -static-libgcc -static-libstdc++
+CXXFLAGS=-m64 -static-libgcc -static-libstdc++
 
 # Fortran Compiler Flags
 FFLAGS=
