GAE Project in IntelliJ IDEA 12/13 on OSX Mavericks

I'm evaluating IntelliJ coming from Eclipse and am having some serious issues doing the most basic tasks.  I've tried the following on 12 Ultimate and the 13 Ultimate preview, both giving me the exact same errors.

I had an eclipse project that was a GAE project.  I followed the "import" procedure in IntelliJ and IntelliJ IDEA both times correctly created a project and identified GAE.  I set the GAE home directory under project structure/modules to the GAE sdk I downloaded (the latest - 1.8.7).  In all of my Action files, I have import errors.

  • Cannot resolve symbol google (from import com.google.*)
  • Cannot resolve symbol http (from import javax.servlet.http.*)


Obviously it seems that it can't find the J2EE container and the GAE app engine.  I'm not sure how IntelliJ organizes projects relative to eclipse so this may be one and the same. If I restart IntelliJ or reload the project I get a popup saying internal IDE exception.  The stacktrace is:
com/google/apphosting/runtime/security/WhiteList : Unsupported major.minor version 51.0: com/google/apphosting/runtime/security/WhiteList : Unsupported major.minor version 51.0
java.lang.UnsupportedClassVersionError: com/google/apphosting/runtime/security/WhiteList : Unsupported major.minor version 51.0
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
 at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:189)
 at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:185)
 at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:146)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:249)
 at com.intellij.appengine.sdk.impl.AppEngineSdkUtil.computeWhiteList(AppEngineSdkUtil.java:103)
 at com.intellij.appengine.sdk.impl.AppEngineSdkImpl.isClassInWhiteList(AppEngineSdkImpl.java:122)
 at com.intellij.appengine.inspections.AppEngineForbiddenCodeInspection$1.visitReferenceElement(AppEngineForbiddenCodeInspection.java:127)
 at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.accept(PsiJavaCodeReferenceElementImpl.java:953)
 at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:185)
 at com.intellij.psi.impl.source.JavaStubPsiElement.acceptChildren(JavaStubPsiElement.java:173)
 at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:55)
 at com.intellij.psi.JavaElementVisitor.visitImportStatement(JavaElementVisitor.java:144)
 at com.intellij.psi.impl.source.PsiImportStatementImpl.accept(PsiImportStatementImpl.java:52)
 at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:185)
 at com.intellij.psi.impl.source.JavaStubPsiElement.acceptChildren(JavaStubPsiElement.java:173)
 at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:55)
 at com.intellij.psi.JavaElementVisitor.visitImportList(JavaElementVisitor.java:140)
 at com.intellij.psi.impl.source.PsiImportListImpl.accept(PsiImportListImpl.java:171)
 at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:185)
 at com.intellij.psi.impl.source.PsiFileImpl.acceptChildren(PsiFileImpl.java:792)
 at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:55)
 at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:32)
 at com.intellij.psi.JavaElementVisitor.visitJavaFile(JavaElementVisitor.java:328)
 at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:411)
 at com.intellij.appengine.inspections.AppEngineForbiddenCodeInspection.checkFile(AppEngineForbiddenCodeInspection.java:60)
 at com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool$1.visitFile(AbstractBaseJavaLocalInspectionTool.java:98)
 at com.intellij.psi.JavaElementVisitor.visitJavaFile(JavaElementVisitor.java:328)
 at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:411)
 at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:74)
 at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$5.process(LocalInspectionsPass.java:382)
 at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$5.process(LocalInspectionsPass.java:377)
 at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:119)
 at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:42)
 at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:82)
 at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166)
 at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:91)
 at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
 at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
 at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:103)
 at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:79)
 at jsr166e.CountedCompleter.exec(CountedCompleter.java:684)
 at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
 at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
 at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
 at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
 at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)


So I'm guessing this is the problem.  From looking around it seems GAE doesn't like Java 1.7 (version 51.0)  for some reason, but I have no way to change the entire environment to be 1.6.  GAE is loaded within the context of IntelliJ, not within the project (so changing project to be 1.6 does nothing to fix this).  I'm running a clean install of OSX Mavericks which only has 1.7, although I tried to switch to 1.6 and intellij wouldn't even load.

What's going on here? I can't submit the above to JetBrains I'm assuming because its an evaluation license, but I'm not purchasing software that doesn't work for the most basic task.
1 comment

So I got this working but there's a lot wrong with this entire process.  Maybe I'm missing something and I'd appreciate some input but this was a huge pain for something that's supposed to work "out of the box" (and something that is part of the $200 minimum you pay for a product).

First, GAE 1.8.7 (and it seems 1.8.6) have some compatibility issues with Java 7.  Not really sure if you guys could do anything about that but it seems running GAE 1.8.7 doesn't work if your installed jdk/java_home is 1.7. I got 1.8.0 and that seems to work fine.

Second, and this is the biggest annoyance, adding the GAE module doesn't actually add the correct libraries for the project.  If you create a new GAE project, the correct libraries will be added as dependencies.  On the import from the ecilpse project, it correctly determined that GAE was part of the project.  However, it did not correctly setup the project to be built.  I had to see how the GAE project was setup for a new one to see what was required.  I'm still not even sure if everything is there correctly.  The "new" GAE project determined it also had a J2EE facet (but didn't do that on creation...which seems weird, only after it was actualy created and building).  My imported GAE didn't, but also said it had a Web facet, which the "new" GAE project didn't.

Last, it didnt' setup any of the artifacts for me.

Overall, this process was very confusing.  I still don't know if my project is setup correctly, but I did setup the artifacts on my own and get the server deployment to seem to work.  Will this work if I push to GAE? I don't know...

I love Resharper and TeamCity for the fact that they "just work".  This was definitely something that needs improvement if you want to win over Eclipse.  I've never had any issues gettting the GAE stuff to "just work" in Eclipse.  

0

Please sign in to leave a comment.