OpenJDK

shell脚本

匆匆过客 提交于 2019-12-12 17:21:31
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> #!/usr/bin/env bash JAR_FILE_NAME="donkey-acl-console.war" findproc() { PID=`ps aux | grep $JAR_FILE_NAME | grep "java" | grep -v "$$" | grep -v grep | awk '{ print $2 }'` } findproc; echo 'find process id : '$PID for i in $PID do /bin/kill -9 $PID done cd `dirname $0` cd .. DEPLOY_DIR=`pwd` JAVA='java' if [ -z `which java` ]; then if [ -z $JAVA_HOME ]; then JAVA=$JAVA_HOME/bin/java else echo 'Cannot find java command and JAVA_HOME.' fi fi if [ ! -z `java -version 2>&1 | grep 'openjdk version' | awk '{print $3}' | egrep '1.[8-10].\d*'` ]; then nohup $JAVA

CentOS + Jenkins

让人想犯罪 __ 提交于 2019-12-12 16:53:47
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> CentOS + Jenkins 2018.09.14 15:04:04字数 507阅读 94 1. 安装JDK 确认此前未安装过JDK,如果安装过先确认jdk不是gcj版本,否则Jenkins可能运行异常,需要卸载重装JDK; 查看jdk版本 # java -version 卸载jdk # yum remove java 搜索open-jdk # yum search openjdk image.png 安装open-jdk # yum install java-1.8.0-openjdk 再检查JDK版本 [root @localhost ~]# java -version openjdk version "1.8.0_161" OpenJDK Runtime Environment (build 1.8.0_161-b14) OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode) 2. 安装GIT,如果已安装则跳过 yum install git 3. 开始安装Jenkins 下载依赖 wget -O /etc/yum.repos.d/jenkins.repo http://jenkins-ci.org/redhat/jenkins.repo

Strange NullPointerException Catch in OpenJDK JAXB Implementation

拟墨画扇 提交于 2019-12-12 13:47:40
问题 I found some strange code in OpenJDK JAXB: com.sun.xml.internal.bind.v2.model.impl.ModelBuilder try { XmlSchema s = null; s.location(); } catch (NullPointerException e) { // as expected } catch (NoSuchMethodError e) { ... } Can some explain why they do this? Or this is just a bad code need to fix. 回答1: They are using this code as a test to determine which version of the JAXB (JSR-222) APIs are being used. The location parameter was added to @XmlSchema in JAXB 2.1, if NoSuchMethodError was

Client ECC SSL Certificate contains “unknown named curve”

谁说我不能喝 提交于 2019-12-12 10:38:02
问题 Question precontext: I am working in an existing library that uses SSL with the netty framework on a remote server. I am running into an SSL/TLS handshake error. The error is as follows: javax.net.ssl.SSLProtocolException: java.io.IOException: Unknown named curve: 1.2.840.10045.3.1.1 at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1345) ~[na:1.7.0_79] at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:519) ~[na:1.7.0_79] at sun.security.ssl.SSLEngineImpl

javac error message does not display entire filepath

喜欢而已 提交于 2019-12-12 08:53:21
问题 When using javac (or the ant task ), the error message does not include the entire filepath, it only includes the file name. For example, $ javac src/path/to/Filename.java Filename.java:1: package foo.bar does not exist import foo.bar.Baz; ^ What I would like is, $ javac src/path/to/Filename.java src/path/to/Filename.java:1: package foo.bar does not exist import foo.bar.Baz; ^ My problem is that vim quickfix does not work if it's not given the entire filepath, not just the filename. With just

How to know if I am using Open JDK or Oracle JDK?

时间秒杀一切 提交于 2019-12-12 08:18:30
问题 Using java -version gives me this. java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) Is it an OpenJDK or OracleJDK ? 回答1: I think that you're using OracleJDK. As I saw with a google search, the openJDK --version output is like this: java -version openjdk version "1.8.0-internal" OpenJDK Runtime Environment (build 1.8.0-internal-0) OpenJDK 64-Bit Zero VM (build 25.0-b20-internal, interpreted mode) See:

Java component not updating most of the time

安稳与你 提交于 2019-12-12 06:13:29
问题 I think I may have found a platform issue with openjdk-1.8.0_45 under ubuntu 15.04. The following program compiles and runs: import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.Timer; public class TimerTime extends JPanel implements ActionListener { private JLabel timeLabel; public TimerTime() { timeLabel = new JLabel( String.valueOf(System.currentTimeMillis()); add( timeLabel ); Timer timer = new Timer(50, this); timer.setInitialDelay(1);

Trying to use SonarQube on Jenkins to analyze project, but Jenkins using JDK 1.7 and I am getting an unsupported major.minor version error

爷,独闯天下 提交于 2019-12-12 02:38:52
问题 I'm trying to analyze a git project using SonarQube and running that through Jenkins, however the Console Output gives me an error when I try to build. java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/ EnvironmentInformation : Unsupported major.minor version 52.0 Screenshot -> http://i.imgur.com/Jb7Wngu.png Which I have learned means I'm using a higher JDK at compile time than I am at runtime. When I ssh into the machine that is hosting Jenkins and the SonarQube server and

How do I cast a List from a subclass generic to a parent class generic?

橙三吉。 提交于 2019-12-12 01:38:43
问题 I'm modifying open JDK to add features and I've run into this twice with no good solution. There's a class named JCStatement which extends JCTree . Issue: I want to cast a List<JCStatement> into a List<JCTree> . It's clear that a class can reference one of its extensions, but when I have it on a List, it just doesn't work. I used: (List<JCTree>)((List<?>)params) to cast, which works, but doesn't build on ant. IDE gives me the following warning: Type safety: Unchecked cast from List<capture#1

Liunx安装更换JDK

风流意气都作罢 提交于 2019-12-12 01:26:26
Linux安装JDK完整步骤 1.查看系统jdk版本 运行命令: java -version openjdk version "1.8.0_102" OpenJDK Runtime Environment ( build 1.8.0_102-b14 ) OpenJDK 64-Bit Server VM ( build 25.102-b14, mixed mode ) 根据系统显示为主,以上代码仅供展示 2.检测jdk安装包 运行命令: rpm -qa | grep java java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64 python-javapackages-3.4.1-11.el7.noarch tzdata-java-2016g-2.el7.noarch javapackages-tools-3.4.1-11.el7.noarch java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64 java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64 java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64 运行命令依次删除上述插件(保留python、javapackages) 运行命令: