OpenJDK

linux系统安装jdk

走远了吗. 提交于 2019-12-01 07:45:21
一、yum安装 1、查看可安装的jdk版本 [root@centos76 ~]# yum -y list java* Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * elrepo: mirrors.neusoft.edu.cn * epel: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com Installed Packages ... 2、选择对应版本进行安装 [root@centos76 ~]# yum install -y java-1.8.0-openjdk* Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile epel/x86_64/metalink | 6.5 kB 00:00:00 * base: mirrors.aliyun.com * elrepo: mirrors.neusoft.edu.cn * epel: mirrors.aliyun.com * extras:

How to resolve module-info.java compile error in Jdk9/java-9

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 05:44:50
I am trying to run below code using jdk-9 but facing problem when compile using command Command javac -d mods .\module-info.java com\nirav\modi\Test.java Error .\module-info.java:1: error: class, interface, or enum expected module module1 { } ^ 1 error module-info.java module module1 { } Test.java package com.nirav.modi; class Test { public static void main(String args[]){ System.out.println("Hello Modular..."); } } package structure is like below module1\module-info.java module1\com\nirav\modi\Test.java JDK Version java version "9-ea" Java(TM) SE Runtime Environment (build 9-ea+153) Java

Intellij IDEA 2017.2 can't add openjk 9 on Linux Mint 18

回眸只為那壹抹淺笑 提交于 2019-12-01 05:26:23
I am using Intellij IDEA 2017.2.5 on Linux Mint 18.2 and trying to add new openjdk-9 SDK but IDEA does not accept openjdk 9 as valid JDK: I have installed all of my SDKs using apt-get from ppa standard repositories. This is my update-alternatives --config java/javac output: Although Intellij declared it would support JDK 9 here , but it seems it is not yet fully compatible with at least opensdk-9. Maybe refactoring SDK directory and removing ' jre ' folder misleads the IDEA to find the SDK 9 home folder. Any idea why Intellij IDEA claims ' The selected directory is not a valid home for JDK ' ?

Possible Java compiler bug! Program does not compile with some compilers

浪子不回头ぞ 提交于 2019-12-01 05:26:12
First, a little background (or skip down a little if not interested). I'm irritated and confused! This should be a pretty simple use case, and indeed my code has been compiling just fine with the Eclipse JDT compiler, so until now I've been configuring Maven to make sure to do this. It's been bothering me too much though that it doesn't compile with the Oracle JDK and OpenJDK, as I thought it may actually have been a problem with my code, so I've looked into it again. I thought perhaps that the bug was in the JDT compiler for allowing it to compile, not the Oracle JDK and OpenJDK for not

Does using the 'this' keyword affect Java performance?

混江龙づ霸主 提交于 2019-12-01 04:16:20
Does using the this keyword affect Java performance at all? In this example: class Prog { private int foo; Prog(int foo) { this.foo = foo; } } Is there performance overhead doing that over the following?: class Prog { private int foo; Prog(int bar) { foo = bar; } } A couple of coworkers and I were discussing this earlier today and no one could come up with an answer the we all agreed on. Any definitive answer? No, not at all. It is just a different syntax for the same thing. It gets compiled into exactly the same piece of bytecode. So say it like a human: you are telling the compiler twice

Possible Java compiler bug! Program does not compile with some compilers

ぃ、小莉子 提交于 2019-12-01 03:50:12
问题 First, a little background (or skip down a little if not interested). I'm irritated and confused! This should be a pretty simple use case, and indeed my code has been compiling just fine with the Eclipse JDT compiler, so until now I've been configuring Maven to make sure to do this. It's been bothering me too much though that it doesn't compile with the Oracle JDK and OpenJDK, as I thought it may actually have been a problem with my code, so I've looked into it again. I thought perhaps that

Intellij IDEA 2017.2 can't add openjk 9 on Linux Mint 18

橙三吉。 提交于 2019-12-01 03:34:24
问题 I am using Intellij IDEA 2017.2.5 on Linux Mint 18.2 and trying to add new openjdk-9 SDK but IDEA does not accept openjdk 9 as valid JDK: I have installed all of my SDKs using apt-get from ppa standard repositories. This is my update-alternatives --config java/javac output: Although Intellij declared it would support JDK 9 here, but it seems it is not yet fully compatible with at least opensdk-9. Maybe refactoring SDK directory and removing ' jre ' folder misleads the IDEA to find the SDK 9

How to resolve module-info.java compile error in Jdk9/java-9

て烟熏妆下的殇ゞ 提交于 2019-12-01 02:42:15
问题 I am trying to run below code using jdk-9 but facing problem when compile using command Command javac -d mods .\module-info.java com\nirav\modi\Test.java Error .\module-info.java:1: error: class, interface, or enum expected module module1 { } ^ 1 error module-info.java module module1 { } Test.java package com.nirav.modi; class Test { public static void main(String args[]){ System.out.println("Hello Modular..."); } } package structure is like below module1\module-info.java module1\com\nirav

在Ubuntu14下构建Hotspot并使用Eclipse调试

坚强是说给别人听的谎言 提交于 2019-12-01 02:17:58
偶尔会看一点点JVM代码,所以尝试构建了一把最新的OpenJDK8 1.环境介绍 1)时间: 2015-05-13 2)系统: Linux haogrgr-vm 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux 3)Eclipse: Eclipse C/C++ 4.4 4)OpenJDK代码: http://hg.openjdk.java.net/jdk8u/jdk8u40 2.JDK安装 这里安装的是构建OpenJDK需要依赖的JDK, 一般是当前构建版本的上一个版本, 比如我们这里需要安装JDK7. sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer sudo apt-get install oracle-java7-set-default # 如果你要安装JDK8: # sudo apt-get install oracle-java8-installer # sudo apt-get install oracle-java8-set-default #

Does using the 'this' keyword affect Java performance?

二次信任 提交于 2019-12-01 01:46:03
问题 Does using the this keyword affect Java performance at all? In this example: class Prog { private int foo; Prog(int foo) { this.foo = foo; } } Is there performance overhead doing that over the following?: class Prog { private int foo; Prog(int bar) { foo = bar; } } A couple of coworkers and I were discussing this earlier today and no one could come up with an answer the we all agreed on. Any definitive answer? 回答1: No, not at all. It is just a different syntax for the same thing. It gets