编译 Java 时使用多核/处理器 [英] Using multiple cores/processors when compiling Java

查看:45
本文介绍了编译 Java 时使用多核/处理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用具有 8 个内核的桌面来使用 Ant(通过 javac 目标)构建 Java 应用程序.有没有办法通过使用多个线程或进程来加快编译速度?

I use a desktop with eight cores to build a Java application using Ant (through a javac target). Is there a way to speed up the compilation by using more than one thread or process?

我知道我可以并行运行多个 Ant 任务,但我不认为这可以应用于单个编译目标,或者可以吗?

I know I can run several Ant tasks in parallel, but I don't think this can be applied to a single compilation target, or does it?

推荐答案

我不知道有什么方法可以告诉 ant 自己有效地使用多核.但是 你可以告诉ant使用Eclipse编译器,它支持多线程编译 内置.

I don't know of any way to do tell ant itself to make effective use of multiple cores. But you can tell ant to use the Eclipse Compiler, which has support for multithreaded compilation built-in.

这篇关于编译 Java 时使用多核/处理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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