Disclaimer: I know the basics of signing an APKs and I have a problem with only one of my projects and only when signing with Microsoft Windows as the OS.>
The solution from Baqueta works also for me.
Use these arguments in the keytool:
-sigalg MD5withRSA -keyalg RSA -keysize 1024
I am still using there in jarsigner:
-sigalg MD5withRSA -digestalg SHA1
Thank you, the APK compiled and installed on a device using Java 7, finally!