Home > Uncategorized > Grails: Error starting Sun’s native2ascii

Grails: Error starting Sun’s native2ascii

More issues with Grails. The environment seemed to be working, but once I start compiling and generating all the files. I ran into more issues. When running the grails war to generate a war to deploy to Mor.ph I go the following error. This error also occurs for the generate-all command.

Error executing script War: : Error starting Sun's native2ascii:
gant.TargetExecutionException: : Error starting Sun's native2ascii:

To fixing it I found this mailing list response. The problem was that my JAVA_HOME environment variable pointed to the JRE and not to the JDK. Changing it to point to the JDK fixed the problem. Below is the entire printout of the error.

Running script C:\dev\grails-1.1\scripts\War.groovy
Environment set to production
Warning, target causing name overwriting of name startLogging
  [groovyc] Compiling 1 source file to C:\Users\Morten\.grails\1.1\projects\GrailsHello3\classes
[native2ascii] Converting 11 files from C:\Users\Morten\IdeaProjects\GrailsHello3\grails-app\i18n to C:\Users\Morten\.grails\1.1\projects\GrailsHello3\resources\grails-app\i18n
Error executing script War: : Error starting Sun's native2ascii:
gant.TargetExecutionException: : Error starting Sun's native2ascii:
    at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:331)
    at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
    at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
    at gant.Gant.withBuildListeners(Gant.groovy:344)
    at gant.Gant.this$2$withBuildListeners(Gant.groovy)
    at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
    at gant.Gant.dispatch(Gant.groovy:334)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.processTargets(Gant.groovy:495)
    at gant.Gant.processTargets(Gant.groovy:480)
Caused by: : Error starting Sun's native2ascii:
    at org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Ascii.run(SunNative2Ascii.java:67)
    at org.apache.tools.ant.taskdefs.optional.native2ascii.DefaultNative2Ascii.convert(DefaultNative2Ascii.java:54)
    at org.apache.tools.ant.taskdefs.optional.Native2Ascii.convert(Native2Ascii.java:268)
    at org.apache.tools.ant.taskdefs.optional.Native2Ascii.execute(Native2Ascii.java:227)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at _GrailsPackage_groovy$_run_closure2_closure13.doCall(_GrailsPackage_groovy:108)
    at _GrailsPackage_groovy$_run_closure2_closure13.doCall(_GrailsPackage_groovy)
    at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:269)
    at _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:107)
    at _GrailsWar_groovy$_run_closure4.doCall(_GrailsWar_groovy:125)
    at War$_run_closure1.doCall(War:38)
    at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
    ... 10 more
Caused by: java.lang.ClassNotFoundException: sun.tools.native2ascii.Main
    at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:156)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:128)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Ascii.run(SunNative2Ascii.java:51)
    ... 22 more
Bookmark and Share
Tags: , ,
  1. October 12th, 2009 at 16:50 | #1

    Thanks. This helped

  2. October 18th, 2009 at 14:49 | #2

    It was helpful. Thanks a lot

  3. tonio
    June 8th, 2010 at 07:56 | #3

    thanks :)

  4. July 2nd, 2010 at 10:37 | #4

    Thank you, this helped me in discovering the problem with my Eclipse even though JAVA_HOME was not the culprit in my case.

  1. February 14th, 2010 at 21:16 | #1