本篇兩部分:php
1,windows下scala的eclipse開發環境html
2,在maven項目中使用scalajava
1,下載並安裝scala,最新版ios
Download Previous Versions | The Scala Programming Languagewindows
http://www.scala-lang.org/download/all.htmlapp
2,eclipse開發環境搭建eclipse
先說結論:最簡單的方法,下載Scala IDE for Eclipse官網提供的集成scala的eclipse。maven
下載頁面:ide
Download Scala IDE for Eclipse - Scala IDE for Eclipseui
http://scala-ide.org/download/sdk.html#
創建scala項目
按照上面的方法安裝重啓eclipse出現:
org.osgi.framework.BundleException: Could not resolve module: org.scalaide.worksheet [878] Unresolved requirement: Import-Package: scala.tools.eclipse.semantichighlighting -> Export-Package: scala.tools.eclipse.semantichighlighting; bundle-version="3.0.4.v-2_11-201407232043-c46f499"; bundle-symbolic-name="org.scala-ide.sdt.core";
version="0.0.0" org.scala-ide.sdt.core [869] No resolution report for the bundle. Unresolved requirement: Import-Package: scala.tools.eclipse; apply-aspects:="false" -> Export-Package: scala.tools.eclipse; bundle-version="3.0.4.v-2_11-201407232043-c46f499"; bundle-symbolic-name="org.scala-ide.sdt.core"; version="0.0.0" Unresolved requirement: Require-Bundle: org.scala-ide.sdt.core; bundle-version="[3.0.4.v-2_11-201407232043-c46f499,3.0.4.v-2_11-201407232043-c46f499]" -> Bundle-SymbolicName: org.scala-ide.sdt.core; bundle-version="3.0.4.v-2_11-201407232043-c46f499"; singleton:="true" Bundle was not resolved because of a uses contraint violation. org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.scalaide.worksheet [osgi.identity;
osgi.identity="org.scalaide.worksheet"; type="osgi.bundle"; version:Version="0.2.3.v-2_11-201407232049-4f7988d"; singleton:="true"] because it is exposed to package
'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.0.v20140606-1445";
singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency
chains.
Chain 1: org.scalaide.worksheet [osgi.identity; osgi.identity="org.scalaide.worksheet"; type="osgi.bundle"; version:Version="0.2.3.v-2_11-201407232049-4f7988d";
singleton:="true"] require: (osgi.wiring.bundle=org.eclipse.core.runtime) | provide: osgi.wiring.bundle: org.eclipse.core.runtime org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.0.v20140606-1445"; singleton:="true"]
Chain 2: org.scalaide.worksheet [osgi.identity; osgi.identity="org.scalaide.worksheet"; type="osgi.bundle"; version:Version="0.2.3.v-2_11-201407232049-4f7988d";
singleton:="true"] require: (osgi.wiring.bundle=org.scala-ide.sbt.full.library) | provide: osgi.wiring.bundle; osgi.wiring.bundle="org.scala-ide.sbt.full.library"; bundle-version:Version="0.13.2.v-2_11-20140723-2242" org.scala-ide.sbt.full.library [osgi.identity; osgi.identity="org.scala-ide.sbt.full.library"; type="osgi.bundle"; version:Version="0.13.2.v-2_11-20140723-2242"] import: (osgi.wiring.package=javax.xml.bind) | export: osgi.wiring.package: javax.xml.bind javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] at org.eclipse.osgi.container.Module.start(Module.java:434) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) |
eclipse Luna4.4版本比較新,參考官方文檔的解釋是不兼容。
Scala IDE for Eclipse官網在安裝需求中說支持3.7,4.2
官方文檔eclipse、jdk、scala版本選擇說的很清楚。
Getting Started — Scala IDE 0.1-SNAPSHOT documentation
http://scala-ide.org/docs/current-user-doc/gettingstarted/index.html
常見問題:
Frequently Asked Questions — Scala IDE 0.1-SNAPSHOT documentation
http://scala-ide.org/docs/user/faq.html
版本代號 平臺版本 主要版本發行日期 SR1發行日期 SR2發行日期
Callisto 3.2 2006年6月26日 N/A N/A
Europa 3.3 2007年6月27日 2007年9月28日 2008年2月29日
Ganymede 3.4 2008年6月25日 2008年9月24日 2009年2月25日
Galileo 3.5 2009年6月24日 2009年9月25日 2010年2月26日
Helios 3.6 2010年6月23日 2010年9月24日 2011年2月25日
Indigo 3.7 2011年6月22日 2011年9月23日 2012年2月24日
Juno 3.8及4.2 2012年6月27日 2012年9月28日 2013年3月1日
Kepler 4.3 2013年6月26日 2013年9月27日 2014年2月28日
Luna 4.4 2014年6月25日 N/A N/A
選擇個能用的eclipse
Eclipse downloads - mirror selection
仍是直接下載集成scala的吧!
直接就能在eclipse運行,連scala自己都不用下載安裝了。
注意:spark和scala的兼容問題。spark1.5.2的源代碼須要在scala2.11下從新編譯。
若是不肯從新編譯,