English 中文(简体)
宣布的一揽子“”与《视觉演播法》中预期的一揽子“弧”不相称。
原标题:The declared package "" does not match the expected package "src" in Visual Studio Code

我最初在一份名为“GravityBallz”的档案中掌握了我所有的java档案,但我随后在GravityBallz的夹中创建了一个称为“弧”的夹,并将其全部放在其中。 现在它给我留下了一个错误。 我试图重新开始工作,但依然没有工作。

增 编

https://i.stack.imgur.com/6Kb3b.png”rel=“nofollow noreferer”> 因此,我添加了

这里,所有问题都是Im 待解决的。

问题回答

Because you had put your java file in src folder, so you need to add "package src" in every java file.

为了消除这些错误,不必在每一档案中申报<条码>包装弧;,你必须熟悉一个非常简单的概念:The Java parpath

大多数Java IDEs 或环境,如VSCode所用的环境,在一份称为“ClassPath”的目录下,搜索贵项目的来源档案。

在 Java方案语言中, 阶级path通常由一个java参数或一个环境变量通过,并在JVERS(Java虚拟机器)研究、Pryn>>。

Eclipse生成的普通档案例

请注意,在图像中,有“弧”和“bin”目录,分别与来源档案和汇编的类别档案相对应。

You can modify this path association in different ways depending on your IDE or Environment. Particularly, in VSCode you can search in the command pallette: "> Java: Configure Classpath"

Example of a project with a configured source classpath

https://i.stack.imgur.com/7QOyt.png” rel=“nofollow noreferer”> 项目结构本身

it will bring you to a simple but useful interface that allows you to select the project you want to configure and all the different directories where you may store your source files and your compiled class files.

这将使你能够把项目结构与你想要的方式混为一谈。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签