Java在线运行

版本:

所属目录
点击了解高性能代码运行API
运行结果
教程手册
代码仓库
极速运行
终端运行
图形+终端

                        
以下是用户最新保存的代码
统计数据出现次数 发布于:2024-12-02 01:36 java构造方法 发布于:2024-11-29 14:44 方法重组 编写一个函数addAll()实现结果; addAll(1,8); addAll(5,6,-7); 发布于:2024-11-27 19:57 java的首次尝试,hello world 发布于:2024-11-26 20:35 class Task 发布于:2024-11-22 15:30 泛型的使用 发布于:2024-11-20 16:41 冒泡排序代码Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5 at PopSort.main(PopSort.java:8) 发布于:2024-11-20 17:29 测试代码【呯呯呯】 发布于:2024-11-19 15:52 book类 发布于:2024-11-16 20:38 类多态的基本联系 发布于:2024-11-16 19:14 //查询驱动板状态 发布于:2024-11-15 15:11 测试代码好 发布于:2024-11-15 13:56 java加密解密测试 发布于:2024-11-14 10:07 Java测试使用 发布于:2024-11-13 10:01 # guess game 发布于:2024-11-12 15:42 反反复复烦烦烦烦烦烦烦烦烦烦烦烦 发布于:2024-11-11 10:27 java代码 发布于:2024-11-08 16:26 打开系统文件窗口。(请使用图形+终端) 发布于:2024-11-06 22:33 一段demo 发布于:2024-11-05 15:15 测试账户密码,以及三次登录现实失败信息 发布于:2024-11-01 10:33 脆生生的方式 发布于:2024-10-31 18:58 一个测试例子 发布于:2024-10-30 09:54 计算图形的面积和周长 发布于:2024-10-29 11:15 接口实现的代码 发布于:2024-10-29 10:58 实验5a源代码完整 发布于:2024-10-26 10:40 计算1到100之间所有数字的和 发布于:2024-10-24 18:02 矩阵螺旋题 发布于:2024-10-22 15:51 测试SWING GUI和JDBC 发布于:2024-10-21 09:58 编程题测试 发布于:2024-10-18 11:46 鸡蛋编辑器 发布于:2024-10-18 10:32 java 17 报数 发布于:2024-10-18 10:14 实验3.java 发布于:2024-10-15 22:11 学生投票系统 发布于:2024-10-14 10:08 简单的爱心 发布于:2024-10-13 15:23 tts合成调整 发布于:2024-10-14 16:38 static 影响属性 发布于:2024-10-12 09:22 构造块代码示例 文件3-12 发布于:2024-10-12 09:00 测试正则表达式 发布于:2024-10-10 17:49 第一个示例程序 发布于:2024-10-10 11:47 实验一个对象 发布于:2024-10-05 03:07 java运算符 发布于:2024-10-02 16:58 java运算符 发布于:2024-10-02 16:58 java homework 发布于:2024-09-28 23:40 安全倒计时 发布于:2024-09-27 17:59 输出回文数金字塔 发布于:2024-09-25 22:12 1-1000素数打印,每行8个 发布于:2024-09-25 20:51 测试代码,随时改 发布于:2024-09-23 18:35 输入输出代码 发布于:2024-09-23 15:30 方法的演示 发布于:2024-09-23 09:56 这是一个石头剪刀布的游戏 发布于:2024-09-23 09:33 [更多]
显示目录

How to Install Oracle JDK 8 On Debian



学习嵌入式的绝佳套件,esp8266开源小电视成品,比自己去买开发板+屏幕还要便宜,省去了焊接不当搞坏的风险。 蜂鸣版+触控升级仅36元,更强的硬件、价格全网最低。

点击购买 固件广场

![java8-debian][] java8-debian

In this tutorial, we will show you how to install Oracle JDK 8 On Debian, manually.

Environment :

  1. Debian 7
  2. OpenJDK 1.7 is installed. (Switch to Oracle JDK 8 later)

At the time of writing, OpenJDK 1.8 is not included in the default apt-get repository yet. I just don’t like the default apt repository schedule, it constantly comes with older or outdated released.

Note
This guide is tested in other Debian derivatives like Ubuntu 14 and Mint 1.7.2.

1. Quick Check

1.1 A quick Java version check :

$ java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~deb7u1)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

$ javac -version
javac 1.7.0_75

An existing OpenJDK 1.7 is installed, no problem, we will show you how to switch it to JDK 8.

1.2 A quick search via apt-cache, there is no openjdk-8… yet.

$ apt-cache search openjdk

...
openjdk-7-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-7-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-6-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-6-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
...

2. Get Oracle JDK 8

1.1 Visit Oracle JDK download page

1.2 Find a Linux x64 version, in this example, we will get the jdk-8u66-linux-x64.tar.gz via wget command.

$ pwd
/home/mkyong

$ wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u66-b17/jdk-8u66-linux-x64.tar.gz

If you don’t want to use wget (why?), just download the file and upload to your server manually.

3. Extracts to /opt/jdk/

3.1 Extracts it to path /opt/jdk/jdk1.8.0_66

$ pwd
/home/mkyong

$ sudo mkdir /opt/jdk/
$ sudo mv ~/jdk-8u66-linux-x64.tar.gz /opt/jdk/
$ sudo cd /opt/jdk/

$ pwd
/opt/jdk/

$ sudo tar -zxf jdk-8u66-linux-x64.tar.gz 
$ ls -ls
total 177056
     4 drwxr-xr-x 3 root root      4096 Oct 27 13:05 .
     4 drwxr-xr-x 3 root root      4096 Oct 27 13:03 ..
     4 drwxr-xr-x 8 uucp  143      4096 Oct  7 00:40 jdk1.8.0_66
177044 -rw-r--r-- 1 root root 181287376 Oct  8 15:56 jdk-8u66-linux-x64.tar.gz

Note
Alternatively, try this one line extraction command.

$ sudo tar x -C /opt/jdk -f jdk-8u66-linux-x64.tar.gz

4. Install JDK

4.1 Make /opt/jdk/jdk1.8.0_66 as a new JDK alternatives for both /usr/bin/java and /usr/bin/javac

$ sudo update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_66/bin/java 100
$ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_66/bin/javac 100

4.2 Update the default JDK, for both java and javac

$ update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      auto mode
* 1            /opt/jdk/jdk1.8.0_66/bin/java                    100       manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /opt/jdk/jdk1.8.0_66/bin/java to provide /usr/bin/java (java) in manual mode
$ update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      auto mode
* 1            /opt/jdk/jdk1.8.0_66/bin/javac                100       manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /opt/jdk/jdk1.8.0_66/bin/javac to provide /usr/bin/javac (javac) in manual mode

5. Verification

Check Java version again.

$ java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
root@hydra:/opt/jdk# 

$ javac -version
javac 1.8.0_66

Done. Enjoy your Lambda!

6. Extras… How to Upgrade?

Let say new jdk1.8.0_99 is released, and we want to upgrade it.

6.1 Download the JDK tar files and extracts it to /opt/jdk/jdk1.8.0_99

6.2 Self-explanatory.

# 6.2.1 Remove the existing alternatives - jdk1.8.0_66
$ sudo update-alternatives --remove java /opt/jdk/jdk1.8.0_66/bin/java
$ sudo update-alternatives --remove javac /opt/jdk/jdk1.8.0_66/bin/javac

# 6.2.2 Install new JDK alternatives - jdk1.8.0_99
$ sudo update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_99/bin/java 100
$ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_99/bin/javac 100

# 6.2.3 Update default JDK again, select /opt/jdk/jdk1.8.0_99
$ update-alternatives --config java 
$ update-alternatives --config javac

# 6.2.4 Remove the old JDK folders
$ sudo rm -rf /opt/jdk/jdk1.8.0_66/

How about upgrade to the upcoming Oracle JDK 9? you know what to do :)

References

  1. Using the Debian alternatives system
  2. How To Manually Install Oracle Java on a Debian or Ubuntu VPS
  3. Debian : Change default Java version
  4. Oracle JDK download page

[java8-debian]:

由JSRUN为你提供的Java在线运行、在线编译工具
        JSRUN提供的Java 在线运行,Java 在线运行工具,基于linux操作系统环境提供线上编译和线上运行,具有运行快速,运行结果与常用开发、生产环境保持一致的特点。
yout