在我的工作区(wsPrivate)中,我有3个Gradle项目。
请参见下面的错误(出现在编译Hangman时):
我已经阅读了关于类路径和如何解决这个[在我看来]“范围问题”的几乎所有信息,也尝试了多种解决方案,但我觉得情况变得更糟了。 在不编译eclipse的情况下,程序可以正常工作,因此我认为其中的代码是正确的。
我现在已经被卡了3天,如果有人能够解释一下我偏离了哪条路线,那就太好了。如果需要更多信息:请问;)
所以这基本上是我目前拥有的:
我的包布局和添加的库:
- Hangman
- PixelView
- Reports
请参见下面的错误(出现在编译Hangman时):
D:\_wsGitlab\wsPrivate\Hangman\src\main\java\game\core\Game.java:10: error: package hangman does not exist
import hangman.Messages;
^
D:\_wsGitlab\wsPrivate\Hangman\src\main\java\game\core\Game.java:13: error: package viewer does not exist
import viewer.Box;
^
D:\_wsGitlab\wsPrivate\Hangman\src\main\java\game\core\Game.java:14: error: package viewer.figures.boxes does not exist
import viewer.figures.boxes.Borders;
我已经阅读了关于类路径和如何解决这个[在我看来]“范围问题”的几乎所有信息,也尝试了多种解决方案,但我觉得情况变得更糟了。 在不编译eclipse的情况下,程序可以正常工作,因此我认为其中的代码是正确的。
我现在已经被卡了3天,如果有人能够解释一下我偏离了哪条路线,那就太好了。如果需要更多信息:请问;)
所以这基本上是我目前拥有的:
我的包布局和添加的库:
我添加到“猜词游戏”中的自定义库:
项目“Hangman”的构建路径上的项目:项目“猜词游戏”的订单和导出:
另外两个被引用的项目(pixelview / reports):
最后是我的build.gradle
文件:apply plugin: 'application'
mainClassName = "game.core.Game"
repositories {
jcenter()
}
dependencies {
compile 'org.apache.commons:commons-math3:3.6.1'
implementation 'com.google.guava:guava:23.0'
testImplementation 'junit:junit:4.12'
}
jar {
baseName = 'HangmanGame'
version = '2.00.0'
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'game.core.Game'
)
}
}