"java.exe" exited with code 1 RRS feed

  • Question

  • User45006 posted


    I am facing with this Java error compiling my Android project with current stable Xamarin version on Windows 8 with VisualStudio 2013.

    I have included the Google Play Services (Jelly Bean) component in the project because I use Google AdMob in my App.

    On the Mac with Xamarin Studio the project compiles and runs without errors. I just had to increase the Java heap.

    I tried to increase the Java heap in the project properties, updated my local Java installation, set the API Level to 16.....but nothing helps.

    I always get the Java.exe exited with code 1 error.

    Any ideas ? Can anyone help me ?



    Thursday, May 8, 2014 9:44 AM

All replies

  • User904 posted

    @marcoseraphin Could you post the complete build log? It will help us to troubleshoot the issue.

    Thursday, May 8, 2014 11:12 AM
  • User45006 posted

    Hello Prashant,

    thanx for your fast reply. And you are right, I forgot further information. I set the build verbose options to details, so a lot of line, but I hope it helps. I attached a file with the build output.

    Thank you,


    Thursday, May 8, 2014 11:50 AM
  • User13824 posted


    The build log shows this error:

    Invalid maximum heap size: -Xmx512MB

    Hopefully the fix will as easy as changing "MB" to "M" in your project settings.

    As a test, you can try running java on the command line:

    "C:\Program Files (x86)\Java\jdk1.6.0_39\bin\java.exe" -Xmx512M

    Thursday, May 8, 2014 9:14 PM
  • User45006 posted

    Hi Brendan,

    I should use my eyes better....you are completely right. Just "M" instead of "MB". No it I got no error compiling.

    BUT, if I could ask this additionally. I get the well know error concerning the Android SDK version 22.6.3.

    If I open an Android layout file in the Android GUI designer I get the following error:

    "Disconnected from layout renderer. Please close and open the file again".

    I have installed the Android SDK Tools 22.6.3.

    Do I have to downgrade ? I have installed the latest java version and the latest Xamarin VisualStudio stable version. (In Xamarin Studio on the Mac I do not face these problems)

    Thanx again,


    Friday, May 9, 2014 6:23 AM
  • User45006 posted

    Hi Brendan,

    I made a downgrade to the Android SDK Tools 22.6.2 as recommended in the forum. Now the layout renderer error is gone.

    So far so good. Will Xamarin VS work with version 22.6.3 ?



    Friday, May 9, 2014 12:28 PM
  • User13824 posted

    Glad you got things up and running! Yes indeed, Xamarin Studio version 4.2.5 now supports Android SDK Tools 22.6.3, and that fix will be brought over to Visual Studio too, likely in the next update.

    Friday, May 9, 2014 3:52 PM
  • User43700 posted

    I have similar mistake

    1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1180,3): error MSB6006: "java.exe" exited with code 1.

    but increasing heap to 512M is not helping

    1 hour ago I could make release all was good. Then I have decided to install Android Studio (to use its axml designer). And installed JDK 1.7 64 bit. Android Studio worked. VS releas not anymore. Then I have deinstalled all java footprints and install only JDK 1.7 - the same java.exe error. Then deinstall all java footprints and install JDK 1.6 - the same.

    How should I solve it, tell me please.

    Here is VS info.

    Microsoft Visual Studio Premium 2012 Version 11.0.61030.00 Update 4 Microsoft .NET Framework Version 4.5.50938

    Installed Version: Premium

    LightSwitch for Visual Studio 2012 04941-004-0043007-02509 Microsoft LightSwitch for Visual Studio 2012

    Team Explorer for Visual Studio 2012 04941-004-0043007-02509 Microsoft Team Explorer for Visual Studio 2012

    Visual Basic 2012 04941-004-0043007-02509 Microsoft Visual Basic 2012

    Visual C# 2012 04941-004-0043007-02509 Microsoft Visual C# 2012

    Visual C++ 2012 04941-004-0043007-02509 Microsoft Visual C++ 2012

    Visual F# 2012 04941-004-0043007-02509 Microsoft Visual F# 2012

    Visual Studio 2012 Code Analysis Spell Checker 04941-004-0043007-02509 Microsoft® Visual Studio® 2012 Code Analysis Spell Checker

    Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

    ASP.NET and Web Tools 2012.3.41009 Microsoft Web Developer Tools contains the following components: Support for creating and opening ASP.NET web projects Browser Link: A communication channel between Visual Studio and browsers Editor extensions for HTML, CSS, and JavaScript Page Inspector: Inspection tool for ASP.NET web projects Scaffolding: A framework for building and running code generators Server Explorer extensions for Windows Azure Web Sites Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

    Color Theme Designer 1.0 Designer for creating new color themes

    NuGet Package Manager 2.8.50313.31 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

    PreEmptive Analytics Visualizer 1.0 Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

    SQL Server Data Tools 11.1.20627.00 Microsoft SQL Server Data Tools

    Xamarin for Visual Studio (b3acb09afda91828e5bd48308ac8e7433d30f330) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android

    Xamarin.Android (7f0e3d3cfb9b36570e8d7862a33d0310238c814d) Visual Studio plugin to enable development for Xamarin.Android.

    Xamarin.iOS (b3acb09afda91828e5bd48308ac8e7433d30f330) Visual Studio extension to enable development for Xamarin.iOS

    Wednesday, May 21, 2014 4:55 PM
  • User13824 posted

    @blaze, thanks for the report! When you get a chance, if you wouldn't mind sending the following additional information in to contact@xamarin.com, that would be perfect:

    • Your current Android SDK version information, for example from the Android SDK Manager, or from Xamarin Studio under "Help -> About Xamarin Studio -> Show Details -> Copy Information"
    • The full diagnostic build output from the Output window.
    • If you like, your whole solution, cleaned and zipped up.

    With some luck, the diagnostic build output might point you directly to a fix.

    Wednesday, May 21, 2014 6:26 PM
  • User43700 posted

    Thanx, Brendan for the help and for the fast answer.... I wasn't be able to enjoy this mistake inside of diagnostic debug window, cause after CLEANING and REBUILDING the project all has just started to work!

    Thursday, May 22, 2014 10:51 AM
  • User13824 posted

    @blaze? Excellent. Glad to hear it's working now!

    Thursday, May 22, 2014 11:15 PM
  • User80121 posted

    i have suffered from this error and finally i decided to sit and fix it I have put a blog with some explantion and solution steps on my blog I have put the solution that worked for me


    Monday, March 9, 2015 8:32 PM
  • User201812 posted

    I have same problem. I increased the max HeapSize to 1G but it didn't work until I increase to 4G But now, I have new error:

    1>COMPILETODALVIK : error : Could not create the Java Virtual Machine. 1>COMPILETODALVIK : error : A fatal exception has occurred. Program will exit.

    How I can solve it?

    Monday, March 7, 2016 4:50 PM
  • User56686 posted


    Thursday, May 5, 2016 10:41 AM
  • User132973 posted


    I am getting the same error:

    Error 26 "java.exe" exited with code 1. C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 2118 3 Elfo.VisionShop.Droid

    And here is the output:

    8> java.io.IOException: Can't read [C:\Users\FranciscoJavier\AppData\Local\Android\android-sdk\platforms\android-24\android.jar] (Can't process class [java/nio/charset/CharsetDecoder.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7))) 8> at proguard.InputReader.readInput(InputReader.java:230) 8> at proguard.InputReader.readInput(InputReader.java:200) 8> at proguard.InputReader.readInput(InputReader.java:178) 8> at proguard.InputReader.execute(InputReader.java:100) 8> at proguard.ProGuard.readInput(ProGuard.java:196) 8> at proguard.ProGuard.execute(ProGuard.java:78) 8> at proguard.ProGuard.main(ProGuard.java:492) 8> Caused by: java.io.IOException: Can't process class [java/nio/charset/CharsetDecoder.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)) 8> at proguard.io.ClassReader.read(ClassReader.java:112) 8> at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) 8> at proguard.io.JarReader.read(JarReader.java:65) 8> at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65) 8> at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53) 8> at proguard.InputReader.readInput(InputReader.java:226) 8> ... 6 more 8> Caused by: java.lang.UnsupportedOperationException: Unsupported class version number [52.0] (maximum 51.0, Java 1.7) 8> at proguard.classfile.util.ClassUtil.checkVersionNumbers(ClassUtil.java:140) 8> at proguard.classfile.io.LibraryClassReader.visitLibraryClass(LibraryClassReader.java:89) 8> at proguard.classfile.LibraryClass.accept(LibraryClass.java:301) 8> at proguard.io.ClassReader.read(ClassReader.java:86) 8> ... 11 more 8> Picked up JAVATOOLOPTIONS: -Dfile.encoding=UTF8 8>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2118,3): error MSB6006: "java.exe" exited with code 1. 8>Done executing task "Proguard" -- FAILED.

    What can I do?

    Wednesday, July 6, 2016 8:59 AM
  • User191123 posted

    Having the same error.

    Also getting error in the output: 2> warning: C:\Users...\AppData\Local\Android\android-sdk\platforms\android-24\android.jar(android/...): major version 52 is newer than 51, the highest major version supported by this compiler. 2> It is recommended that the compiler be upgraded.

    Thursday, July 14, 2016 10:44 AM
  • User70 posted

    JDK 1.7 vs. 1.8 I believe is causing this - you may have 1.8 and Xamarin.Android I believe is bound to 1.7 (proguard)

    Friday, July 15, 2016 6:14 PM
  • User213951 posted

    In my case the ProGuard was the cause of the compilation fail.

    Monday, January 16, 2017 6:02 AM
  • User12817 posted

    This is caused by an old version of Proguard shipped with the Android SDK:


    I hope this helps!

    Monday, January 23, 2017 9:15 PM
  • User176749 posted

    this happens sometimes when there isnt enough space on the disk of the emulator or phone

    Friday, May 11, 2018 2:07 PM
  • User387842 posted

    I have applied every solutions I have seen so far but still, my project wont build with proguard enabled.

    error "java.exe" exited with code 1..

    Any help will be appreciated. Thanks

    Wednesday, July 31, 2019 2:22 AM
  • User176749 posted

    One another reason this happens is if you set a singing key path on android settings and keystore cannot be found on that path. It happened to me today after changing to a new PC and path was empty.

    Monday, March 16, 2020 8:18 PM
  • User393324 posted

    Hi .. I had the same error and it is due to the signature of the android package keystore

    Monday, April 6, 2020 5:29 AM
  • User199554 posted

    After updating Xamarin.Forms to The latest one in VS 2017 , i start having "MSB6006: "java.exe" exited with code 1. " in debug and Release Mode .

    Wednesday, April 15, 2020 11:34 AM
  • User176749 posted

    4.5 have a lot of problems registered in the github issues. please check there. there might be your issue. otherwise you may create one.

    Wednesday, April 15, 2020 3:04 PM