title: unable to locate the java compiler com.sun.to while running grails app in ubuntu
body: <p>i tried different fixes avaiable with this name. but non worked.</p>
  
  <p>i have following under printenvi.</p>
  
  <pre><code>PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/root/bin:/home/thinkvidya-kiran/programs/jdk1.6.0_45/bin:/home/thinkvidya-kiran/programs/jdk1.6.0_45/bin:/home/thinkvidya-kiran/programs/james-2.3.2/bin:/home/thinkvidya-kiran/programs/grails-2.1.1/bin
  PWD=/usr/lib/jvm
  JAVA_HOME=/home/thinkvidya-kiran/programs/jdk1.6.0_45
  </code></pre>
  
  <p>tried </p>
  
  <pre><code>sudo ln -s /path/to/jre*/bin/java /usr/bin/java
  </code></pre>
  
  <p>and java and javac are giving me correct output. and i tried putting -vm thing in eclispe.ini. non working for me its giving following error.</p>
  
  <pre><code> | Loading Grails 2.1.1
  | Configuring classpath.
  | Environment set to development.....
  | Compiling 1 source files..
  | Compiling 2 source files.
  | Error Compilation error: startup failed:
  General error during semantic analysis: unable to locate the java compiler com.sun.tools.javac.Main, please change your classloader settings
  java.lang.ClassNotFoundException: unable to locate the java compiler com.sun.tools.javac.Main, please change your classloader settings
      at org.codehaus.groovy.tools.javac.JavacJavaCompiler.findJavac(JavacJavaCompiler.java:190)
      at org.codehaus.groovy.tools.javac.JavacJavaCompiler.compile(JavacJavaCompiler.java:49)
      at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit.gotoPhase(JavaAwareCompilationUnit.java:97)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:513)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:482)
      at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:60)
      at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:216)
      at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:935)
      at org.codehaus.groovy.grails.compiler.Grailsc.compile(Grailsc.java:79)
      at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:629)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:622)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at groovy.util.AntBuilder.performTask(AntBuilder.java:260)
      at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:220)
      at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
      at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:170)
      at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
      at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:99)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
      at org.codehaus.groovy.grails.compiler.GrailsProjectCompiler.compile(GrailsProjectCompiler.groovy:263)
      at org.codehaus.groovy.grails.compiler.GrailsProjectCompiler$compile$0.callCurrent(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
      at org.codehaus.groovy.grails.compiler.GrailsProjectCompiler.compile(GrailsProjectCompiler.groovy:234)
      at org.codehaus.groovy.grails.compiler.GrailsProjectCompiler$compile.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
      at _GrailsCompile_groovy$_run_closure2_closure6_closure7.doCall(_GrailsCompile_groovy:48)
  </code></pre>