- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用Eclipse 2018-12从Oracle JDK 8迁移到Open JDK 11.0.1时,我显然发现了另一个与JPMS相关的错误在模块化 java 项目中很难使用外部非模块化 .jar。我将问题追溯到下面的完整示例。
这个例子源自一个真实项目的迁移过程(使用仍然非模块化的javax.servlet.api),这引起了一些头痛。它由四个 Maven 项目M、N、Y 和 X 组成,每个项目组成一个 Java 模块,另一个 Maven 项目组成一个非模块化 Java 项目W。我使用 maven 和 maven-compiler-plugin 3.8.0。我的观察是:
显然,在顶级项目中重新声明像模块w这样的自动化模块似乎会导致内置Eclipse编译器出现问题并且不允许我们工作正确地使用 Eclipse(而运行该项目效果很好)。在我看来,这种不匹配是 Eclipse 2018-12 中的另一个错误(以及我在 Automatic modules not found in Eclipse 2018-12 when project is opened 和 Java module not found at runtime even with requires transitive 中描述的问题)。
我的问题是:有人可以确认这是一个错误吗,还是已经知道了?对我们来说,这完全是一个阻碍,因为我们的项目依赖于不同的库,这些库既不是模块化的,也没有 Automatic-Module-Name 属性。只要本文中描述的 Eclipse 错误存在,我们就无法进一步迁移到 JDK 11。
附注:我们不想在从 SCM checkout 后配置我们的项目以使其在 Eclipse 中运行。对于我们来说,直到现在还没有必要(在使用 Maven 和 Eclipse 时,这实际上非常好,感谢迄今为止使这一切成为可能的每个人!),而且我几乎试图避免手动配置我们的 Eclipse 项目或运行配置的模块路径。
<小时/>所以,这是完整且可重现的示例:
M 项目(模块化)
// M.java
package m;
import com.example.n.N;
public class M {
public static void main(String[] args) {
System.out.println("M");
N.main(null);
}
}
// module-info.java
open module m {
requires n;
requires w;
}
// pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mavenexample2</groupId>
<artifactId>m</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.mavenexample2</groupId>
<artifactId>n</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.mavenexample2</groupId>
<artifactId>y</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
N 项目(模块化)
// N.java
package com.example.n;
public class N {
public static void main(String[] args) {
System.out.println("N");
}
}
// module-info.java
open module n {
exports com.example.n;
}
// pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mavenexample2</groupId>
<artifactId>n</artifactId>
<version>0.0.1-SNAPSHOT</version>
</project>
项目 Y(模块化)
// Y.java
package com.example.y;
public class Y {
public static void main(String[] args) {
System.out.println("Y");
}
}
// module-info.java
open module com.example.y {
exports com.example.y;
requires com.example.x;
}
// pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mavenexample2</groupId>
<artifactId>y</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.mavenexample2</groupId>
<artifactId>x</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Project X(模块化)
// X.java
package com.example.x;
public class X {
public static void main(String[] args) {
System.out.println("X");
}
}
// module-info.java
open module com.example.x {
exports com.example.x;
requires w;
}
// pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mavenexample2</groupId>
<artifactId>x</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.mavenexample2</groupId>
<artifactId>w</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Project W(非模块化)
// W.java
package external;
public class W {
public static void main(String[] args) {
System.out.println("W");
}
}
// pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mavenexample2</groupId>
<artifactId>w</artifactId>
<version>0.0.1-SNAPSHOT</version>
</project>
请执行Maven >更新项目...>所有操作,以便在定义项目或更改模块依赖项后使所有内容保持同步。另外,请在执行 mvn clean install 后关闭非模块化项目 M,否则您会收到此处描述的错误:Automatic modules not found in Eclipse 2018-12 when project is opened .
最佳答案
事实上,Eclipse 有一个错误,只有当编译以非常特定的顺序执行时才会出现。
Background: In the era of JPMS a package has different content depending on which module is asking. In the example different modules see different configurations for package
com.example
: from some p.o.v. it contains a child packagen
in other perspectives it doesn't. For performance sake, each result of such lookup is cached, which caused the order dependence: which module first looked up packagecom.example
decided what contributions to the package were known.Curiously, the same JPMS that makes split packages illegal, requires a compiler to treat each parent package with multiple contributing modules as a split package, causing a significant increase in implementation complexity.
(已编辑:) 该错误已被解决为 Eclipse bug 543765 ,该修复自 2019-03 版本起可用。
关于java - JDK11迁移: Compilation error shown in Eclipse 2018-12 but code runs fine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54329075/
微调 API 中关于 model 属性的 OpenAI 文档说明有点令人困惑: model The name of the base model to fine-tune. You can selec
微调 API 中关于 model 属性的 OpenAI 文档说明有点令人困惑: model The name of the base model to fine-tune. You can selec
当涉及到语言模型(LLM)的教学微调时,什么时候应该选择有监督的微调培训器(SFTTrainer)而不是常规的Transformers培训器?据我所知,常规的Transformers培训人员通常指的是
最近在处理后台数据时需要实现文件上传.考虑到对浏览器适配上采用Fine Uploader. Fine Uploader 采用ajax方式实现对文件上传.同时在浏览器中直接支持文件拖拽[对浏览器版本有
1f45bd1e8577af66a05f5e3fadb0b29 通过ORPO对llama进行微调 前言 ORPO是一种新颖的微调技术,它将传统的监督微调和偏好对齐阶段整合到一个过程中。这减少了训
我希望使用 Fineuploader 为每个上传的项目添加标题/名称。每个附件都会在其旁边显示一个文本框,以便用户可以在按“上传”之前输入标题/名称 like this 我看过了,每个上传请求都会发送
假设我想一次上传多个文件,将 multiple 选项设置为 true 时我可以这样做: var myUploader = new qq.FineUploader({ element: $('#
使用 Fineuploader v3.3 的 jQuery 封装版本。 是否可以使用上传文件夹中已有的文件填充文件列表? 我认为“_addToList(id, name)”应该可以解决问题,但我无法让
log4j.properties log4j.rootLogger=FINE, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppende
我想在我的小程序中使用 java util 日志记录,日志级别为 FINE 及以下。 我在我的小程序的 jar 中放了一个 logging.properties 文件 handlers= java.u
我的域层需要一个实体具有与之关联的 1:N 图像。 由于 FineUploader 将每个图像作为单独的请求发送,我在第一个请求上创建一个实体(服务器端),并在第一个响应 JSON 中发送回该 ID
关闭。这个问题需要debugging details .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 2年前关闭。 Improve this questio
我阅读了有关使用 Fine Uploader 进行缩放的文档: http://docs.fineuploader.com/features/scaling.html 是否可以仅考虑图片的高度来缩放图片
我正在使用很好的 uploader ,它运行得很好。现在,即使上传成功,它也会重试。这样一来,我就有了四个文件,而不是只有一个。 http://fineuploader.com/ 我的代码:
当我运行 Maven 时,我得到的输出就好像我指定了日志记录级别 FINE 一样,这使得很难找到实际的输出。我还得到了数百行列出显式和隐式绑定(bind)的信息。据我所知我根本没有配置 mvn 。我正
我在我的表单中使用 FineUploader:http://docs.fineuploader.com/branch/master/features/forms.html . 问题是,在我的表单文件中
我已经为此发了几个小时的消息,但无法让它工作。我对fineuploader的实现 $(document).ready(function() { //alert(qq.supportedFeatures
我有一个关于 fine uploader (3.0) 的奇怪问题,它适用于除 ie9 之外的所有浏览器。 没有js错误,就是上传一个0byte失败了。我正在使用 valums php,它在这里失败了:
我正在实现类似 Google Plus 上传窗口的功能,当窗口中的整个灰色区域 (div) 都可以点击时,文件选择器就会出现。 这是我正在尝试做的事情的简单模型代码 (jsfiddle) $(func
我正在使用Fine-uploader(繁体版)试图让用户上传文件到我们自己的服务器。我现在面临的挑战是我应该在正常上传过程之前先从服务器获取 token 。 token 将与每个上传请求/ block
我是一名优秀的程序员,十分优秀!