Gradle下编译Modular的问题

鸡窝里的毛 鸡窝里的毛 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
请问各位大神,这个问题怎么解决?

我创建一个Gradle项目,然后加进了module-info.java


module test {
exports test;
requires com.google.common;
requires fastjson;
}


然后运行:gradlew.bat build报错了。


Working Directory: E:\java\test
Gradle user home: E:\gradle\home
Gradle Distribution: Local installation at E:\gradle\gradle-6.5
Gradle Version: 6.5
Java Home: E:\openjdk\jdk-14
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: build


> Task :compileJava FAILED
E:\java\test\src\main\java\module-info.java:4: 错误: 找不到模块: fastjson
requires fastjson;
^
1 个错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 345ms
1 actionable task: 1 executed


...全文

相关推荐

java9-modular-example:Java 9模块示例-模块化编程

Java 9模块示例 模组 欢迎 techprimers.helloworld techprimers.helloyoutube

高晖云

AOSP -- 第一章 概述

本文系统阐述AOSP作为Android开源底层基座的定义、边界及分层架构,涵盖Linux内核、HAL、原生服务、ART、system_server至应用层的完整栈式结构;明确AOSP与GMS、厂商定制层的区分;详解Treble、GKI、Mainline、APEX等关键演进机制;并梳理源码组织、维护职责、开发工具链及核心IPC(Binder)、HAL接口语言(AIDL/HIDL)等关键技术要素。

千里马-horse

Android-一个Kotlin示例应用采用模块化KotlinDSLKotlinCoroutinesTDD和MVVM模式构建

一个Kotlin示例应用,采用模块化、Kotlin DSL、Kotlin Coroutines、TDD和MVVM模式构建

weixin_39841882

Android代码-modular

Sample app of modular architecture. Gradle-modules in sample: Dagger-components in sample: Video from Mobius Saint-Petersburg 2018 about this sample: will be soon...

weixin_39840515

boot-gradle-modular:带有Gradle的示例多模块Spring Boot应用程序

Spring Boot:带Gradle的多模块 带有Gradle的示例多模块Spring Boot应用程序 执照 This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or au

CodeWizardess
评论 3
收藏 已收藏
分享
返回顶部
鸡窝里的毛
Java SE 62,621 成员 307,251 内容