简体   繁体   English

我可以安装Java但不能安装Java SE吗?

[英]Can I install java but not Java SE?

I've got a little question (just for a cultural purpose). 我有一个小问题(仅出于文化目的)。

Would it be possible to download and install Java but not the standard edition ? 可以下载并安装Java,但不能下载和安装标准版吗?

I know that Java SE contains basic and usefull functions / librairies (such as input /output). 我知道Java SE包含基本和有用的函数/库(例如输入/输出)。 Installing java without the "SE" is maybe useless and without any interest, but is it possible? 在没有“ SE”的情况下安装Java可能毫无用处,没有任何兴趣,但是有可能吗? if yes how ? 如果是,怎么办?

Many thanks, 非常感谢,

Installing java without the "SE" is maybe useless and without any interest, but is it possible? 在没有“ SE”的情况下安装Java可能毫无用处,没有任何兴趣,但是有可能吗?

It is not possible. 这不可能。 Oracle don't distribute a form of Java without libraries. 没有库,Oracle不会分发Java形式。

In fact, there is no such thing as Java without the libraries (SE or ME). 实际上,没有库(SE或ME)就没有Java之类的东西。 The libraries are part of Java(tm) platform. 这些库是Java(tm)平台的一部分。 If you managed to create something with the Java language and a JVM, but with partial, missing or incompatible libraries you couldn't call it Java 1 . 如果您设法使用Java语言和JVM创建了某些东西,但是使用了部分库,缺少库或不兼容库,则不能将其称为Java 1 Oracle owns the Java trademark, and they dictate the terms under which you are allowed to use it. Oracle拥有Java商标,并且它们规定了允许您使用该商标的条款。 If you used "Java" for a JVM / Library combination that doesn't pass the standard Java compatibility tests, you would likely get a "cease and desist" letter from Oracle's lawyers! 如果您将“ Java”用于未通过标准Java兼容性测试的JVM /库组合,则可能会收到Oracle律师的“终止并终止”信!

But more importantly, there is a significant subset of the Java SE runtime libraries that are essential for bootstrapping a JVM. 但是更重要的是,Java SE运行时库中有很大一部分对于引导JVM是必不可少的。 If you were to build your own (ahem) Java build that left out critical classes, your JVM wouldn't work. 如果您要构建自己的(糟糕的)Java构建而忽略了关键类,那么您的JVM将无法正常工作。

(And you cannot just simply 2 write your own replacement for the Java SE library subset that the JVM depends on. There are many places where the C / C++ codebase for the OpenJDK JVM has intimate knowledge of the implementation details of the Java libraries. Figuring it all out ... from scratch ... would be challenging.) (而且,您不能只简单地编写2个您自己的替代品来替换JVM所依赖的Java SE库子集。在许多地方,OpenJDK JVM的C / C ++代码库都对Java库的实现细节有深入的了解。全部...从头开始...将具有挑战性。)

Having said that, in Java 9 they introduced a tool called jlink which will produce a cut-down Java SE runtime for an application that only contains the libraries that are required by the application. 话虽如此,他们在Java 9中引入了一个名为jlink的工具,它将为应用程序生成一个缩减的Java SE运行时,该运行时仅包含该应用程序所需的库。 Your can read about it here . 您可以在这里阅读。


1 - For example, the Sun vs Microsoft lawsuit over Microsoft's attempt to "embrace and extend" Java 1.1. 1-例如,针对Microsoft试图“拥抱和扩展” Java 1.1的Sun诉Microsoft诉讼。 See What does Sun's lawsuit against Microsoft mean for Java developers? 请参阅Sun对Microsoft的诉讼对Java开发人员意味着什么?

2 - It's not impossible. 2-并非不可能。 Just a lot of really hard work. 真的很辛苦。

The java command is traditionally from a SE installation. 传统上, java命令来自SE安装。 Typically in the JRE form, but occasionally I the JDK variation for advanced users. 通常以JRE形式出现,但偶尔我会为高级用户提供JDK版本。 Others exist but are not for desktop usage. 其他存在,但不用于桌面。

So in that view you cannot install java without SE. 因此,在该视图下,如果没有SE,就无法安装Java。

(note: Java EE is not a distribution as such but an API typically provides by big web servers) (注意:Java EE本身不是一种发行版,而是通常由大型Web服务器提供的API)

Can I install Java but not Java SE? 我可以安装 Java但不能安装 Java SE吗?

Install? 安装? No. Not from any "official" distributions provided by Oracle, at least. 不。至少不是来自Oracle提供的任何“官方”发行版。

Why not? 为什么不?

Because Oracle doesn't package it that way. 因为Oracle不会那样打包。 They offer 1) a Java SE development kit (JDK) which lets you create Java programs for yourself, or 2) a Java SE JRE which just lets you run Java programs that someone else created. 他们提供1)一个Java SE开发工具包(JDK),让您自己创建Java程序,或2)一个Java SE JRE,它让您运行别人创建的Java程序。 There is no 3) Java without SE. 没有 3)没有SE的Java。

But couldn't they have given us option #3? 但是他们不能给我们选项3吗?

Could they have? 他们可以有? Probably. 大概。 Well, OK, maybe . 好吧, 也许吧 Did they? 他们做了吗? No. 没有。

But theoretically it's possible, right? 但是从理论上讲是可能的,对吧?

Theoretically , I don't see why not. 从理论上讲 ,我不明白为什么不这样做。 Theoretically , it ought to be possible to come up with a "Java" that's little more than a virtual machine and a compiler. 从理论上讲 ,应该有可能提出一个“ Java”,它只不过是虚拟机和编译器。 Then, theoretically , using only this non-Java-SE Java language, you could either replicate the Java SE environment or develop an entirely new Java-based development platform. 然后,从理论上讲 ,仅使用这种非Java-SE Java语言,您就可以复制Java SE环境或开发一个全新的基于Java的开发平台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM