2012-06-15 23 views
0

我在eclipse(helios)中通過maven運行一個簡單的spring hello world項目。我已經安裝了m2eclipse插件。maven在eclipse中使用m2eclipse的目標列表

當我用鼠標右鍵單擊

myproject>>>>Run As>>>>Run configurations>>>>and press 'select' in front of 'Goals'

它展示了一個沒有目標的空單。爲什麼???我曾試圖 Empty goals list in m2Eclipse (MAVEN)給出解決方案,但它並沒有工作

其實我想做的事就是我的編譯項目作爲我用

mvn compiler:compile

插件在命令行做的。

在日食中我能夠使用乾淨的資源:資源,但我無法編譯我的項目。

編輯: 它顯示錯誤:

Please ensure you are using JDK 1.4 or above and not a JRE (the com.sun.tools.javac.Main class is required). In most cases you can change the location of your Java installation by setting the JAVA_HOME environment variable.

+0

我在[http://maven.40175.n5.nabble.com/Unable-to-locate-the-Javac-Compiler-Problem-td 133804.html](http://maven.40175)找到答案.n5.nabble.com /無法找到Javac-Compiler-Problem-td%E2%80%8C%E2%80%8B133804.html) –

回答

0

我的目錄也是空的,但如果你已經知道你要執行的目標,你可以簡單地輸入。所以如果你想編譯你的項目,只需在「Goals:」之後鍵入「compile」,然後點擊Run。

+0

感謝Fabricio!我通過在'http:// maven.40175.n5.nabble.com /無法找到Javac-Compiler-Problem-td133804.html'上的帖子解決了問題。 –

相關問題