在IntelliJ中,当我尝试从构建菜单进行构建时,我收到此奇怪的错误消息:错误:java:不支持版本10
我不明白这一点,因为在项目结构中设置了以下设置:项目SDK:9.0项目语言级别:SDK默认模块语言级别:项目默认(两个模块)
在我的pom.xml文件中,两个模块中都设置了这些属性:
<maven.compiler.source>9</maven.compiler.source>
<maven.compiler.target>9</maven.compiler.target>
Run Code Online (Sandbox Code Playgroud)
我不知道为什么要尝试将JDK 10用于任何东西,但我仍然收到该消息。我很高兴使用JDK10,但是我的项目在该版本中不起作用,所以我回头看看它可以在哪个版本中使用。我安装了适用于1.4到10版本的SDK,我也尝试过使用JDK 1.8,但收到的错误消息略有不同:错误:java:目标发行版无效:10我发现可以使用JDK 9从命令行进行构建,但是我需要从IDE中进行构建。谁能告诉我如何使用JDK 1.9或1.8构建项目?谢谢。
我在swift中制作一个iOS应用程序,我正在尝试以编程方式创建一个collectionView.我想使用我自己的UICollectionReusableView子类作为collectionview的标题,因为我需要一些按钮和标题中的可伸缩图像.
SupView是UICollectionReusableView.
override func viewDidLoad() {
super.viewDidLoad()
let layout = UICollectionViewFlowLayout()
layout.headerReferenceSize = CGSizeMake(self.view.frame.width, 200)
someView = SupView(frame: CGRectMake(0, 0, view.frame.width, 200))
collectionView = UICollectionView(frame: self.view.frame, collectionViewLayout: layout)
collectionView.delegate = self
collectionView.dataSource = self
collectionView.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: "Cell")
collectionView.registerClass(UICollectionReusableView.self, forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: "headerCell") // UICollectionReusableView
self.view.addSubview(collectionView)
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试插入补充视图viewForSupplementaryElementOfKind,就像这样但我在尝试创建标题时遇到错误:
func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
var reusableView : UICollectionReusableView? = nil
// Create header
if (kind == UICollectionElementKindSectionHeader) {
// Create Header
let headerView …Run Code Online (Sandbox Code Playgroud) 我是Java流的新手,手头有问题。我有这样的地图:
Map<String, List<String>> specialProductsMap
Run Code Online (Sandbox Code Playgroud)
我想将映射值展平到一个集合,其中包含列表中所有String值specialProductsMap。如何使用Java Streams做到这一点?