让 Java 与 Windows 10 Ubuntu 一起工作 [英] Getting Java to work with Windows 10 Ubuntu

查看:27
本文介绍了让 Java 与 Windows 10 Ubuntu 一起工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 Windows 10 周年更新,以便我可以在 Windows 上的 Ubuntu 上尝试 Bash.请参阅 如何安装它.我想看看它的性能如何.然后我按照 这篇文章 安装了 Oracle Java JDK,因此我可以将编译时间与本机 Windows Java 编译器进行比较.

I installed the Windows 10 Anniversary Update so that I could try Bash on Ubuntu on Windows. See how to install it. I wanted to see how performant it was. I then installed the Oracle Java JDK as per this article, so I could compare compilation times with the native Windows Java compiler.

然后我尝试在我的项目上运行 Maven,但没有成功.Maven 刚刚开始挂起.我在任务管理器中注意到java"进程在 92% 的 CPU 上徘徊.

I then tried to run Maven on my project, but it didn't work. Maven just hung starting. I noticed in Task Manager that the "java" process was hovering around 92% CPU.

所以我尝试了一些简单的方法.我创建了一个虚拟的 Java Hello-world 类并尝试用 javac 编译它.同样,javac"进程占用了大约 92% 的 CPU.

So I tried something simple. I created a dummy Java Hello-world-like class and attempted to compile it with javac. Similarly, the "javac" process sat around 92% CPU.

我认为这可能与无头运行有关,但 -Djava.awt.headless=true 选项并没有让它变得更好.

I thought maybe it had something to do with running headless, but the -Djava.awt.headless=trueoption didn't make it any better.

有没有人让这个工作或有什么可以尝试的?

Has anyone got this to work or have anything to try?

更新:

我还尝试安装 Open JDK 而不是 Oracle JDK(通过 sudo apt-get install openjdk-7-jdk),结果相同.

I also tried installing the Open JDK instead of the Oracle JDK (via sudo apt-get install openjdk-7-jdk) with the same result.

推荐答案

我想通了.我无法直接从 Oracle 使用下载.相反,我必须按照 这个链接.以下是步骤:

I figured it out. I couldn't use the download directly from Oracle. Instead I had to install it as per this link. Here are the steps:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

这篇关于让 Java 与 Windows 10 Ubuntu 一起工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆