我无法理解缺少什么/要安装什么才能在 cmd 中编译我的代码。它在 IntelliJ IDE 中工作,我看到过类似的问题,但无法掌握有关使用“胖罐子”和 maven 依赖项的答案。
ain.java:1: error: package com.googlecode.lanterna.graphics does not exist
import com.googlecode.lanterna.graphics.TextGraphics;
^
Main.java:2: error: package com.googlecode.lanterna.screen does not exist
import com.googlecode.lanterna.screen.Screen;
^
Main.java:3: error: package com.googlecode.lanterna.screen does not exist
import com.googlecode.lanterna.screen.TerminalScreen;
^
Main.java:4: error: package com.googlecode.lanterna.terminal does not exist
import com.googlecode.lanterna.terminal.DefaultTerminalFactory;
^
Main.java:5: error: package com.googlecode.lanterna.terminal does not exist
import com.googlecode.lanterna.terminal.Terminal;
^
Main.java:6: error: package com.googlecode.lanterna.terminal.virtual does not exist
import com.googlecode.lanterna.terminal.virtual.DefaultVirtualTerminal;
这是 pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>at.htl</groupId>
<artifactId>lanternademo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.googlecode.lanterna</groupId>
<artifactId>lanterna</artifactId>
<version>3.1.1</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</project>