简体   繁体   中英

How to import GAE java project (with maven) in Eclipse?

I'm reading this: https://cloud.google.com/java/getting-started/using-forms and i'd like to import this project in Eclipse from 0, but i'm getting a lot of errors. (Generally any GAE projects). What are the steps to do this? Create new Java project, run Maven (?) and so on... I need to use Mars 2 and have installed jdk 1.7 and 1.8. THX.

(PS: It works using the guide. So i can run the app on cmd)

Update: errors after András Kerekes'solutions 在此处输入图片说明

Try to follow these steps:

  1. git clone the whole Getting Started Java repository
  2. run mvn eclipse:eclipse in the top level directory of the cloned repository
  3. import the projects into Eclipse (including the one at the top level: the project is called getting-started-java , you should see it in the Project Explorer) using File > Import... > Maven > Existing Maven Projects
  4. You may see an error dialog about Maven errors, in the Action field, click on the cell and select to option to install the m2e connector for the JDT compiler. This will install a plugin into your Eclipse to bridge M2Eclipse and the JDT, you'll need to restart Eclipse once it finishes.
  5. You may still see Maven errors like Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (execution: default-compile, phase: compile) , which is OK. You dependencies should be set for the project and there should be no compilation error.
  6. Ensure that the project uses JDK8 as it depends on classes that are only available since Java 8 (like java.util.function.Function )
  7. You may want to install the Cloud Tools for Eclipse plugin for additional GAE support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM