0

I am facing the same issue. I have tried cleaning multiple times the project. Tried creating new workspace Tried clean installation, but still facing the same issue

Failure:

Loading Grails 2.4.4
.
|Environment set to production
.................................
|Packaging Grails application
...........
|Compiling 115 source files  [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  [groovyc] C:\src\sw\compiler\test\reports\TRez\grails-app\domain\automatedreports\TestRun.groovy: 3: unable to resolve class java.sql.SQLType
  [groovyc]  @ line 3, column 1.
  [groovyc]    import java.sql.SQLType;
  [groovyc]    ^
  [groovyc] 
  [groovyc] 1 error

.Error 
|
Compilation error: startup failed:
C:\src\sw\compiler\test\reports\TRez\grails-app\domain\automatedreports\TestRun.groovy: 3: unable to resolve class java.sql.SQLType
 @ line 3, column 1.
   import java.sql.SQLType;
   ^
1 error
Error |
org.codehaus.groovy.grails.cli.ScriptExitException
Error |
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Error |
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
Error |
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
Error |
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
---more like this

Can anyone please help as I am completely stuck here

  • 2
    java.sql.SQLType has been added with Java 8. Are you compiling against Java 7? See also https://stackoverflow.com/questions/29287688/source-code-compatibility-between-java-7-8-for-overloaded-functions – moxn Dec 14 '17 at 09:25
  • Yes. I was using Java7 – Gagandeep Chhabda Dec 27 '17 at 10:34

1 Answers1

0

java.sql.SQLType doesn't exist before Java 8. It is almost certainly a problem with the version of Java you are compiling with being 7 or lower. Ensure you have Java 8 installed and your JAVA_HOME environment variable is set correctly to point at the Java 8 install. Refer to this question for more details: How do I make grails choose the right JDK?

Peter
  • 29,498
  • 21
  • 89
  • 122