skallin / google-plugin-for-eclipse

Automatically exported from code.google.com/p/google-plugin-for-eclipse
Eclipse Public License 1.0
0 stars 0 forks source link

GPE should select jre more smart when compile jsp files. #310

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
For some reasons, I need to run my eclipse use java 8. But when use the deploy 
tool of GPE,
it turns out that it ALWAYS use the jre that runs eclipse, even if you set the 
compile level(https://developers.google.com/eclipse/docs/jdk_compliance).

What is the expected output? What do you see instead?
GPE should use the jre and compile level which is configured in the project 
property.

What version of the product are you using? On what operating system?
Eclipse luna(4.4.1), Windows.

Please provide any additional information below.
Many people have the same problem: 
http://stackoverflow.com/questions/23932859/how-to-deploy-glass-java-starter
http://stackoverflow.com/questions/23285441/gae-500-server-error

Original issue reported on code.google.com by Dollyn....@gmail.com on 23 Oct 2014 at 7:41

GoogleCodeExporter commented 9 years ago
I finally find out that the problem is:
com.google.appengine.tools.admin.Application#compileJavaFiles()

In this method, although it's given an  ApplicationProcessingOptions object 
which provide the javac.exe path computed from the eclipse settings, but it is 
not used. When compiling Java files, they use system java.home property instead:

  private void compileJavaFiles(String classpath, File webInf, File jspClassDir,
      ApplicationProcessingOptions opts) throws IOException {

    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    if (compiler == null) {
      throw new RuntimeException(
          "Cannot get the System Java Compiler. Please use a JDK, not a JRE.");
    }
    ......
  }

Original comment by Dollyn....@gmail.com on 13 Nov 2014 at 12:58