java中,scala中代码检测当前环境的版本
//来自spark源码
// sparkContext初始化的时候写着
private def warnDeprecatedVersions(): Unit = {
val javaVersion = System.getProperty("java.version").split("[+.\\-]+", )
if (javaVersion.length >= && javaVersion().toInt == ) {
logWarning("Support for Java 7 is deprecated as of Spark 2.0.0")
}
if (scala.util.Properties.releaseVersion.exists(_.startsWith("2.10"))) {
logWarning("Support for Scala 2.10 is deprecated as of Spark 2.1.0")
}
}
核心代码
System.getProperty("java.version")//获取java版本
scala.util.Properties.releaseVersion//获取scala版本
java中,scala中代码检测当前环境的版本的更多相关文章
- Akka系列(五):Java和Scala中的Future
前言....... 随着CPU的核数的增加,异步编程模型在并发领域中的得到了越来越多的应用,由于Scala是一门函数式语言,天然的支持异步编程模型,今天主要来看一下Java和Scala中的Futrue ...
- Java访问Scala中的Int类型
出错代码 写java 和 scala 混合代码的时候遇到一个小问题 def extractRefInputFieldsWithType(exprs: JList[RexNode]): Array[(I ...
- postgresql 入门(含java、scala连接代码)
1.下载安装包 官网:http://www.postgresql.org/download/ 按自己需求,下载安装包, 我下载的windows版32位的.http://get.enterprisedb ...
- Scala 中的函数式编程基础(三)
主要来自 Scala 语言发明人 Martin Odersky 教授的 Coursera 课程 <Functional Programming Principles in Scala>. ...
- 5.scala中的对象
排版乱?请移步原文获得更好的阅读体验 1.单例对象 scala中没有静态类或者静态方法,都是通过object实现的,它表示某个类的单例对象.如object People是class People的单例 ...
- 转:【Java并发编程】之八:多线程环境中安全使用集合API(含代码)
转载请注明出处:http://blog.csdn.net/ns_code/article/details/17200509 在集合API中,最初设计的Vector和Hashtable是多线程安 ...
- 如何在Java代码中使用SAP云平台CloudFoundry环境的环境变量
本文使用的例子源代码在我的github上. 在我的公众号文章在SAP云平台的CloudFoundry环境下消费ABAP On-Premise OData服务介绍了如何通过Cloud Connector ...
- 在scala中调用java代码
详细代码请见https://github.com/lujinhong/scalademo 在scala中调用java代替非常非常简单,直接调用即可 (一)一个简单示例 1.创建一个java类 pa ...
- scala中java并发编程
Runnable/Callable 线程(Thread) Executors/ExecutorService Future 线程安全问题 示例:搜索引擎 解决方案 Runnable/Callable ...
随机推荐
- Code a simple telnet client using sockets in python
测试端口是否开放的python脚本 原文: https://www.binarytides.com/code-telnet-client-sockets-python/ 配置: 120.79.14.8 ...
- Linux中基于hadoop安装hive(CentOS7+hadoop2.8.0+hive2.1.1)
http://blog.csdn.net/pucao_cug/article/details/71773665
- [Javascript Crocks] Compose Functions for Reusability with the Maybe Type
We can dot-chain our way to great success with an instance of Maybe, but there are probably cases wh ...
- [Firebase] 1. AngularFire, $save, $add and $remove, Forge
Basic angularFire options: $save, $add and $remove. The way connect firebase: var app = angular.modu ...
- [小技巧] gcc attribute error 属性小试
gcc __attribute__ 里有一个属性是 error 能够用于编译时报错. 參考: https://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Functio ...
- Ajax datatype:'JSON'的error问题Status1:200,JSON格式
转自:http://blog.sina.com.cn/s/blog_6e001be701017rux.html <script src="../js/jquery-1.8.0-vsdo ...
- xcode 调试程序 lldb 使用
xcode 调试程序 lldb 使用 一:lldb是什么 https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/g ...
- 微信小程序 - 自定义components组件详解A篇
官网API:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/component.html 自定义 ...
- nginx 设置错误的自己定义404页面跳转到500
5年前写的站, 当时是在apache下写的error page, 换了nginx后, 404页面直接跳到了500 server内部错误. 仅仅须要在配置 try_files 的时候指定一下就能够了 我 ...
- QtGui.QBrush
The QtGui.QBrush is an elementary graphics object. It is used to paint the background of graphics sh ...