java 相关问题

Java(不要与JavaScript或JScript或JS混淆)是一种通用的,静态类型的,面向对象的编程语言,旨在与Java虚拟机(JVM)结合使用。 “Java平台”是已安装用于开发和运行Java程序的工具的计算系统的名称。将此标记用于涉及Java编程语言或Java平台工具的问题。

期刊文章的 Liferay 模型监听器不显示标题

我是 Liferay 的新手,正在从事网络内容文章(期刊文章)的模型作家工作。创建后保留标题和内容很重要。我写了一个简单的脚本...

回答 1 投票 0

在 Java 中将对象作为参数传递给方法的最佳方法是什么? [已关闭]

我想将从 Player 类创建的名为 user 的对象传递到我的playerSetup 方法中。但是,当我将 user 传递到方法中并尝试调用 user.setName() 时,Java 给出了错误并且

回答 1 投票 0

使用 Java 访问 MS Graph 中的 getAllSites() 方法时出现 AccessDenied

使用 Java 访问 MS Graph 中的 getAllSites() 方法时出现 AccessDenied 错误。我从 Microsoft Learn 获取了这段代码。当我尝试执行此代码时,我收到了 Access

回答 1 投票 0

在模块 jetified-firebase-iid-20.1.5-runtime 中发现重复的 class.com.firebase.iid.FirebaseInstanceIdReceiver

在模块 jetified-firebase-iid-20.1.5-runtime (com.google.firebase-iid:20.1.5) 和 jetified-firebase-messaging-23.1.1 中发现重复的 class.com.firebase.iid.FirebaseInstanceIdReceiver -运行时(com.

回答 2 投票 0

FOREGROUND_SERVICE_SPECIAL_USE 需要运行时检查

我正在使用前台服务,并根据 Google 指南针对 Android 14 进行更新。 在大多数 Android 14 设备上,这工作正常,但在某些设备上,我遇到以下异常 我就是

回答 1 投票 0

需要使用Jsoup登录的Java抓取网站

我想从 streetinsider.com 打印一些数据(div with class="news_article")。我创建了一个帐户,需要登录才能访问这些数据。 谁能解释一下为什么这段代码不起作用...

回答 1 投票 0

KafkaConsumer 无法处理 200 万条记录

我在通过消费者从 kafka 主题获取 200 万条记录时遇到问题。 我的要求是获取记录并将这些记录存储到映射中并将该映射返回给其他方法...

回答 1 投票 0

Java ~version 抛出找不到主类的错误 ~version

Java - 版本工作正常,该版本已安装,但 java ~version 无法工作。然后我尝试通过 jmeter 录制脚本,但脚本没有在 jmx 中录制。 jmx 下载选项...

回答 1 投票 0

提供的参数无效:Java 服务器启动失败

我最爱的人你好! 我收到了一台装有 Windows 11 的新笔记本电脑。我已经安装了 Crystal 2016 (SP09),安装了 JDK,并完成了所有安装。这些与 tomcat 服务上的版本相同...

回答 1 投票 0

带有 Kubernetes 发现客户端的 Spring Cloud Gateway,用于 http 和 grpc 请求

我正在尝试使用 Spring Cloud Gateway 和 k8s 客户端发现来实现网关服务,该服务将重定向 http/1.1 和 http/2(GRPC) 请求 我设置了以下配置: 服务器: ...

回答 1 投票 0

无法访问类 com.sun.tools.javac.api.JavacTrees(在 jdk.compiler 模块中)

我使用java21定制了一个注释处理程序。注释处理器所在项目的pom文件如下所示: 我使用 java21 定制了一个注释处理程序。注释处理器所在项目的pom文件如下所示: <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> <parent> <groupId>org.example</groupId> <artifactId>xxx-xx</artifactId> <version>1.0-SNAPSHOT</version> </parent> <artifactId>xxx-xx-xx</artifactId> <packaging>jar</packaging> <name>async-log-client</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>21</java.version> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>com.google.auto.service</groupId> <artifactId>auto-service</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>21</source> <target>21</target> <encoding>UTF-8</encoding> <compilerArgs> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> </compilerArgs> </configuration> </plugin> </plugins> </build> </project> 我使用 mvn clean install 命令打包到本地存储库。当我将其用作其他项目的依赖项时,出现以下错误 class org.example.MyCustomProcessor (in unnamed module @0x3b48e183) cannot access class com.sun.tools.javac.api.JavacTrees (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.api to unnamed module @0x3b48e183 我尝试在使用该自定义注释处理器的项目中导入 jdk 模块。 <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>21</source> <target>21</target> <encoding>UTF-8</encoding> <compilerArgs> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> <arg>--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> </compilerArgs> </configuration> </plugin> </plugins> </build> 但是好像还是不行。我的目标是构建一个类似 lombok 的注释处理器项目。其他项目可以直接依赖它来运行注释处理器 根据您提供的github上的项目,解决方案如下: pom.xml 将 google.auto.service.version 从 1.0 修改为 1.0-rc1 <properties> ... <google.auto.service.version>1.0-rc1</google.auto.service.version> ... </properties> AsyncLogProcessor.java async-log-main/async-log-client/src/main/java/org/example/async/log/client/annotation/AsyncLogProcessor.java 3号线 import com.google.auto.service.AutoService; 打开 auto-service-1.0.jar 并查找 /com/google/auto/service/。 AutoService.class 不存在。 打开 auto-service-1.0-rc1.jar 并查找 /com/google/auto/service/。 AutoService.class 存在。 只有1.0-rc1版本可以支持您的代码(导入com.google.auto.service.AutoService)

回答 1 投票 0

JavaFX 的 TableView 具有突出显示文本和省略号功能

我想要实现的是能够突出显示 TableView 中文本的某些部分,同时保留纯 Label 时存在的省略号功能...

回答 2 投票 0

如何在甘特图中将x轴设置为int而不是日期

我正在尝试使用甘特图生成任务调度程序图表,但遇到了一些问题。 X 轴如何显示为数字而不是日期。 有没有办法写一个函数

回答 2 投票 0

仅当我使用 eclipse 时,我的应用程序前端在使用 intellij 时不会打开

我有一个已迁移到 SpringBoot 的遗留应用程序,当我通过 Eclipse 运行它而不配置任何不同的东西时,它会运行,当我访问我的 http://localhost:8080 时,它会打开正常...

回答 1 投票 0

用于泛型的 <?> 或不带 <?>

我有一个关于Java中的泛型和instanceof运算符的问题。 不可能进行这样的 instanceof 检查: if (arg instanceof List) // 不可能,因为 ...

回答 3 投票 0

将对象作为参数传递到 Java 方法中的最佳方法是什么? [已关闭]

我想将从 Player 类创建的名为 user 的对象传递到我的playerSetup 方法中。但是,当我将 user 传递到方法中并尝试调用 user.setName() 时,Java 给出了错误并且

回答 1 投票 0

我的spring项目中没有生成jar文件

我的名字是亚历克斯。我正在学习spring,并且已经完成了一个项目。现在我想将它上传到互联网并发布在我的作品集中。但是,当我在 c 中给出以下命令时...

回答 1 投票 0

在浏览器中打开 pdf 时,隐藏 pdf 工具栏“转到”部分的页数

从java端我将tiff图像转换为PDF,如下所示。 矩形页面大小 = new 矩形(maxWidth, maxHeight); 文档 document = new Document(pagesize); PdfWriter.getInstance(文档, o...

回答 1 投票 0

application.yml支持环境变量吗?

我尝试在 application.yml 配置中使用环境变量,例如: 春天: 主要的: 显示横幅:假 --- 春天: 简介: 生产 服务器: 地址:$OPENSHIFT_DIY_IP 港口:$

回答 5 投票 0

Spring 安全警告:如何修复 AuthenticationProvider 与 UserDetailsService 配置?

使用 Spring Security 配置启动 Spring Boot 应用程序时遇到警告。警告消息是: 警告 [restartedMain] r$InitializeUserDetailsManagerConfigurer:Glo...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.