Scala2.11.8 + Sbt + Maven + IntelliJ Idea + Spark2.0开发环境搭建备忘

高效的大数据开发环境搭建及实战  内容大纲: 一、开发环境准备1. IDE开发工具选择及安装2. Java SDK版本选择及安装3. Spark开发语言 版本选择及安装4. 下载Spark的安装程序5. 安装Maven6. 安装sbt7. IDE的插件选择、安装及配置 二、从零开始创建第一个Spark程序 - HelloSpark1. 创建Scala工程2. 添加Spark依赖的jar包3. 修改工程pom文件,并更新依赖包4.... 阅读详情

已有hadoop yarn 和 spark 集群部署、运行在分布式环境中,程序开发编码在PC上,由于逐渐增多scala编写spark2.0程序,入乡随俗使用sbt和IntelliJ Idea,顺便对PC上的Scala + sbt + maven + IntelliJ Idea一些要注意的开发环境配置细节进行记录,侧重于现在网上比较少总结又可能让人有些困扰的部分,目前这方面总结比较完整的文章好像还比较少(也可能是自己看的不够多),有些内容也是google国外和自己摸索的,在此进行记录,一方面方便跟可能有同样需求的程序猿们讨论交流,一方面给做个备忘记录。


整体上主要是以下几个步骤。

1. Java JDK 安装与配置

2. Scala2.11.8 安装与配置

3. maven 安装与配置设置文件

4. sbt 安装与配置sbt-lauch.jar包

5. 集成开发环境IDE IntelliJ Idea 安装与配置插件

6. 通过sbt依赖创建 Spark2.0 项目


1. Java JDK 安装与配置

官网下载对应操作系统的安装包,做好环境变量配置,命令行java 相关命令成功执行,网上很多参考文档,不多叙述。


2. Scala 安装与配置

官网下载对应操作系统的安装包,做好环境变量配置,命令行scala相关命令成功执行,网上很多参考文档,不多叙述。


3. maven 安装与配置设置文件

maven或sbt等开发管理软件的使用,在开发中能够较为系统的生成开发目录结构,管理依赖关系,帮开发人员节省时间,提高效率,当然具体使用与否还是看个人实际开发情况选择,没有maven或sbt等管理软件也可以照样开发。

官网下载对应操作系统的安装包,解压到自己设定的目录,成功执行mvn相关命令。

(1)由于国内连接默认maven仓库,网络状况和速度是个老大难问题,可以在maven目录下conf/settings.xml文件配置修改<mirrors></mirrors>部分,查找并增加国内外的当时仍有效的快速maven仓库镜像,比如阿里云的maven仓库镜像。先备份原有settings.xml文件,再如下修改当前settings.xml。

<mirror> 

    <id>nexus-aliyun</id>

    <name>Nexus aliyun</name>

    <url>http://maven.aliyun.com/nexus/content/groups/public</url> 

    <mirrorOf>central</mirrorOf> 

</mirror>

(2)本地下载保存依赖的目录路径,默认是.m2下面(Linux用户家目录里面,Windows C盘用户目录里面),可以改为其他指定目录,修改conf/settings.xml文件,<localRepository>修改为指定路径</localRepository>,以防在用户目录下被误删或受到其他影响。

(3)这时候没有安装IDE,可以通过mvn命令生成maven项目,修改pom.xml,管理项目依赖包,进行代码编写,编辑器自选。

IntelliJ IDEA中Scala开发环境搭建与HelloWorld实战指南 Java虚拟机(JVM)作为跨平台运行环境,为多种编程语言提供了执行基础。Scala作为一门运行于JVM之上的多范式编程语言,融合了面向对象与函数式编程特性,其强大的类型系统和表达能力使其在大数据处理、分布式计算等领域备受青睐。在工程实践中,集成开发环境(IDE)的配置是项目启动的关键环节,直接影响开发效率与代码质量。IntelliJ IDEA凭借其智能代码补全、深度框架集成和丰富的插件生态,成为Scala开发的主流选择。通过正确配置JDK版本、安装Scala插件并理解sbt构建工具,开发者可以快速搭建高效 阅读详情

相关推荐

Windows系统下Scala环境搭建与sbt项目配置全攻略

JVM(Java虚拟机)作为跨平台运行环境,为多种编程语言提供了统一的基础设施。Scala作为一门运行在JVM上的多范式编程语言,通过结合面向对象与函数式编程的特性,实现了代码的简洁性与表达力。其技术价值在于能够无缝调用Java生态库,同时为高并发、大数据处理场景提供了更优雅的解决方案,广泛应用于分布式系统、实时数据处理等领域。本文聚焦于Windows平台,针对环境变量配置、构建工具选择等关键环节,详细解析了通过sbt(Scala Build Tool)管理项目依赖与版本隔离的最佳实践,并提供了从Hello

weixin_30555515的博客 370

win10 spark+scala+eclipse+sbt 安装配置

转载请务必注明原创地址为:http://dongkelun.com/2018/03/15/winSparkConf/ 1、首先安装配置jdk1.8以上,建议全部的安装路径不要有空格 2、安装spark 2.1 下载 下载地址:http://spark.apache.org/downloads.html,我下载的是 spark-2.2.1-bin-hadoop2.7.tgz 2...

主要分享大数据相关的知识,如Spark、Hudi 2573

删除win10电脑U盘使用记录

手工删除:和查看的方法类似,分三步,缺一不可,顺序也不能反! 第一步 设置环境变量,变量名为“devmgr_show_nonpresent_devices”,值为“1”。 第二步 打开设备管理器,勾上“查看”菜单中的“显示隐藏设备”。如果之前已经打开设备管理器,则要关了,重新打开。 第三步 清除“磁盘驱动器”、“存储卷”、“通用串行总线控制器”3个栏目下所有的灰色的图标,注意是所有!右键点击灰色图标,然后选择“卸载”。 成功 :结果USBSTOR 没有了 ...

qq_40544338的博客 2万+

形式化方法(Formal Methods)和人工智能(Artificial Intelligence)

一、形式化方法(Formal Methods) ​ 形式化方法最初应用在硬件上,验证硬件的正确性,后面逐渐应用到软件编程中,能够在软件中找到软件的错误,验证软件的安全可靠。形式化方法更加接近离散数学,所以其应用难度非常大,同时学习成本也较高。再加上形式化方法的大多数理论还停留在上个世纪,由于程序越来越复杂,导致形式化方法进行验证需要大量人工和时间,以至于现在绝大部分软件开发人员完全没有考虑过这个方法,甚至没有听说过这个名词。 ​ 形式化方法最新的应用成果是在工业上,比如一些极其重要且对安全性要求极高的领域(

qq_37030400的博客 4008

XTDrone——无人机基于2D激光Lidar进行二维运动规划(细节提醒以及相关报错解决)

本文介绍了在Ubuntu 20.04系统无人机基于ROS Noetic实现HectorSLAM二维激光建图与运动规划的完整流程。主要内容包括:安装必要ROS依赖库;修改HectorSLAM的launch文件,解决坐标系转换问题;配置地图发布参数以避免覆盖已建地图;启动PX4仿真环境与XTDrone通信模块;最后通过2D导航目标点实现无人机运动规划。文中详细说明了各步骤的关键配置修改,并提供了处理常见错误(如TF转换超时)的解决方案。实现了从激光SLAM建图到路径规划的过程。

weixin_45390670的博客 996

别再买模块了!手把手教你用FT232RL-REEL芯片,从零设计一个USB转串口电路板

本文详细介绍了如何使用FT232RL-REEL芯片从零设计USB转串口电路板,涵盖核心器件选型、原理图设计、PCB布局布线及焊接调试等关键步骤。通过实战案例和性能对比,展示自制电路板在成本、性能和可靠性上的优势,特别适合硬件爱好者和工程师参考。

weixin_30561425的博客 433

一文搞懂多速率信号处理中信号插值的本质:从插 0、插原值到线性插值!

信号插值在数字信号处理中经常被使用,但“插值”背后究竟发生了什么,却常被忽略。插0、插原值、线性插值看似只是不同的实现方式,实则对应着完全不同的频域效应与滤波特性。本文将结合公式与MATLAB仿真,深入剖析插0、插原值与线性插值三种典型策略的本质区别。

m0_66360845的博客 919

自动化测试与AI的结合应用

自动化测试,人工智能,机器学习,深度学习,测试用例生成,缺陷预测,测试优化 1. 背景介绍 在软件开发领域,自动化测试已成为不可或缺的一部分,它可以提高测试效率、降低测试成本,并确保软件质量。然而,传统的自动化测试方法往往依赖于人工编写的测试用例,这不仅耗时费力,而且难以应对复杂软件

AI架构师小马 2247

【感知模块算法】障碍物detect+trace+prediction方向介绍

系列文章目录 提示:这里可以添加系列文章的所有文章的目录,目录需要自己手动添加 TODO:写完再整理 文章目录系列文章目录前言一、多维度看感知问题,体会复杂性二、障碍物/环境目标detect方向1.视觉目标检测方向(1)图像处理认知(2)视觉基础理论部分1、获取数据集---python网页爬虫、买数据、自己录数据、使用开源比赛的数据集2、opencv库的学习3、深度学习框架学习(3)视觉目标检测理论(1)目标检测的概念(2)目标检测的应用场景(3)现有目标检测框架原理及论文【这仅仅是我当初入门学习的框架~

qq_35635374的博客 2894

YOLOv11改进 | 注意力篇 | YOLOv11引入24年最新的ELA注意力机制,并构建C2PSA_ELA

为了解决这些限制,本文介绍了一种高效的本地注意力(ELA)方法,实现了一个简单的结构,大幅度的性能改善。我们精心设计了ELA中的三个超参数,产生了四个不同的版本:ELA-T,ELAB,ELA-S和ELA-L,以满足不同视觉任务的具体要求,如图像分类,目标检测和语义分割。到此本文的正式分享内容就结束了,在这里给大家推荐我的YOLOv11改进有效涨点专栏,本专栏目前为新开的,后期我会根据各种前沿顶会进行论文复现,也会对一些老的改进机制进行补充,如果大家觉得本文帮助到你了,订阅本专栏,关注后续更多的更新~

tsg6698的博客 1285

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

下一篇: programming in Scala 学习(一)
bitbyteworld
博客等级 码龄10年 3粉丝 10原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值