Open davisusanibar opened 9 months ago
There may not be an option to continue using IntelliJ JPS build for our Java modules project.
IntelliJ offers the following options for compiling Java projects:
Option (1) and (3) work without errors because these options honors maven/pom.xml definitions.
Option (2) uses their own native compiler. IntelliJ IDEA compiles code using a tool called JPS (JetBrains Project System). JPS is designed to speed up compiling by performing incremental and background compilations.
To continue using option (2) we need to "Delegate build and run actions to Maven" using these steps.
Delegating build and run actions to Maven will result in the following features being lost:
HI @jduo, James. Do you have any hacks for building Arrow Java modules within IntelliJ?
Would you be able to suggest any next steps to resolve this issue, @danepitkin / @lidavidm:
@vibhatha
I configure my IntelliJ's build to use maven rather than use its own build system:
https://www.jetbrains.com/help/idea/delegate-build-and-run-actions-to-maven.html#delegate_to_maven
That option is far, far slower (at least for me) though.
I was able to get part of Arrow building inside IntelliJ when I set the source/target level to 21. But I ran into cases where the module-info declarations were incorrect. If we fix those we might be able to create a Maven profile for IntelliJ specifically that lets it use its builtin build system.
I was able to get part of Arrow building inside IntelliJ when I set the source/target level to 21. But I ran into cases where the module-info declarations were incorrect. If we fix those we might be able to create a Maven profile for IntelliJ specifically that lets it use its builtin build system.
I observed the same.
I went a few steps ahead and got stuck here
/home/arrowuser/github/fork/arrow/java/memory/memory-unsafe/src/main/java/module-info.java:21:35
java: module not found: org.apache.arrow.memory.core
Hello.
Hello. I am interested in Java in addition to the Arrow code, and I'm wondering if there is a way to set up an environment and perform code using IntelliJ?
From what I can see, there doesn't seem to be a clear solution to this issue yet. How do other people configure their environment to work with Java code?
Basically, the IDE intelligence will be semi broken and you can only build on command line (or tell IntelliJ to invoke Maven which is basically the same thing in as far as you can't get incremental builds anymore)
This seems sufficient for me so far:
diff --git a/java/memory/memory-core/src/main/java/module-info.java b/java/memory/memory-core/src/main/java/module-info.java
index 52fcb52d0..b6364ee36 100644
--- a/java/memory/memory-core/src/main/java/module-info.java
+++ b/java/memory/memory-core/src/main/java/module-info.java
@@ -25,4 +25,7 @@ module org.apache.arrow.memory.core {
requires transitive jdk.unsupported;
requires jsr305;
requires org.slf4j;
+ requires org.checkerframework.checker.qual;
+ requires org.immutables.value.annotations;
+ requires java.compiler; // for javax.annotation.processing
}
diff --git a/java/pom.xml b/java/pom.xml
index 7c4683a72..0422e71a1 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -112,8 +112,8 @@ under the License.
<doclint>none</doclint>
<additionalparam>-Xdoclint:none</additionalparam>
<!-- org.apache:apache overrides -->
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
<maven.plugin.tools.version>3.12.0</maven.plugin.tools.version>
<surefire.version>3.2.5</surefire.version>
<version.apache-rat-plugin>0.16.1</version.apache-rat-plugin>
@@ -308,8 +308,6 @@ under the License.
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
- <excludes>**/module-info.java</excludes>
- <testExcludes>**/module-info.java</testExcludes>
<useModulePath>false</useModulePath>
<annotationProcessorPaths>
<path>
@@ -456,11 +454,6 @@ under the License.
</sourceFileExcludes>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.arrow.maven.plugins</groupId>
- <artifactId>module-info-compiler-maven-plugin</artifactId>
- <version>${project.version}</version>
- </plugin>
<plugin>
<groupId>com.gradle</groupId>
<artifactId>develocity-maven-extension</artifactId>
So As soon as JDK8 is removed, this should be fine?
No, it turns out it fails at runtime
java.lang.module.FindException: Module org.checkerframework.checker.qual not found, required by org.apache.arrow.memory.core
I got this earlier, can you add this to the modules?
It's because IntelliJ doesn't add Checker Framework's JAR to the runtime path for some reason.
At run-time, for me, Intellij doesn't load any of the Arrow Jars for some sort of an odd reason.
I figured out my issue at least.
This is enough to fix IntelliJ
Describe the enhancement requested
The process of executing
mvn clean install
did not encounter any problems when we were trying to build Java modules by command line (i.e. Github CI).The following error appears if we are trying to run and debug tests using an IDE.
Component(s)
Java