Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

package wrong(java) #1

Closed
xbdeng opened this issue May 1, 2021 · 10 comments
Closed

package wrong(java) #1

xbdeng opened this issue May 1, 2021 · 10 comments
Labels
Invalid This doesn't seem right Question User questions

Comments

@xbdeng
Copy link

xbdeng commented May 1, 2021

All the packages can't work normally.
For example:
package cn.edu.sustech.cs307.dto.prerequisite;

If change the package to package main.java.cn.edu.sustech.cs307.dto.prerequisite; It will be ok.

I wonder how to solve this problem. I think changing all the packages is not so good.....

@NewbieOrange NewbieOrange added Invalid This doesn't seem right Question User questions labels May 1, 2021
@NewbieOrange
Copy link
Owner

Please import this project as a maven project. main and java is not part of the package.

@NewbieOrange
Copy link
Owner

Note that when cloning project using Intellij IDEA, select "Trust Mode" for maven.

You should also be able to get maven working by right-clicking on the project in project window, and choose "Add Framework Support", then choose Maven.

@xbdeng
Copy link
Author

xbdeng commented May 1, 2021

Thank you for your explanation!

Sorry, I can't find maven after I click the "Add Framework Support"

image

There is still something wrong like this.

image

@NewbieOrange
Copy link
Owner

You may open pom.xml and see if there is a trust project button.
trust project

@xbdeng
Copy link
Author

xbdeng commented May 1, 2021

Sorry, I haven't seen this button all the time.

But when I clone the project, I choose a trust bottom like this.
image

@NewbieOrange
Copy link
Owner

After trust and syncing the maven project, it still does not work? Does maven gives any error message?

@xbdeng
Copy link
Author

xbdeng commented May 1, 2021

Yes, there are many errors

image

@xbdeng
Copy link
Author

xbdeng commented May 1, 2021

Thank you for your patience!

I have solved this problem successfully!

Good night!

@NewbieOrange
Copy link
Owner

@xbdeng consider putting your solution here for other students having same problem. :)

@xbdeng
Copy link
Author

xbdeng commented May 2, 2021

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Invalid This doesn't seem right Question User questions
Projects
None yet
Development

No branches or pull requests

2 participants