Intellij IDEA sstrange packges inside maven project - maven

I am currently creating an empty spring boot project, and every time I make it these strange empty packages appears in the hierarchy of packages view scope . !
my package is com.dmlabs.hourly and I have nothing to do with those other empty packages
I don't know where to post this to got help, but for the dev community, can anyone solve this?

Related

Intellij complaining about JDK location

First Image
Second Image
As I attached 2 images, I am having trouble running my spring boot gradle project written in groovy.
As soon as I open the project, intellij tries to build the project and it fails saying Gradle Sync failed.
Since it is complaining about java home in the jdk setting, I was trying to change the path as my intellij expects. but as soon as I change it, it tells me that it cannot find android sdk location. and I have no idea why it cares about android sdk. This project is about spring batch job using gradle and groovy.
I have been searching why it happens for days now and online is talking about ardroid studio solution. and those solution do not apply to my problem.
Can someone help me with this issue please?
Thank you in advance.
It looks like you are running Android Studio instead of IntelliJ IDEA.
The former doesn't support projects other than targeted for Android, so your project will not work there.
Make sure you run IntelliJ IDEA. You can get it at https://www.jetbrains.com/idea/download/index.html.

spring initializr: Cannot import org.slf4j.LoggerFactory for Gradle projects

I'm trying to learn how to build "Spring Web" web-applications using IntelliJ IDEA, and I'm encountering a very frustrating issue when I try to create a new project using "Spring Initializr".
For some reason when I choose to create a "Gradle Project", Java or Kotlin, I'm not able to import org.slf4j.LoggerFactory
If I manually add the import statement, it doesn't resolve, and if I try to get InteliJ to automatically add the import, it instead adds the following...
import com.sun.org.slf4j.internal.LoggerFactory
This satisfies the editor, but it won't compile. It errors with...
Symbol is declared in module 'java.xml.crypto' which does not export package 'com.sun.org.slf4j.internal'
If instead I create a "Maven Project", either Kotlin or Java, then it works as expected.
I'm keeping the other settings in spring initializr set to default values, Spring Boot=2.4.2, Java=11
IntelliJ IDEA says there are no updates available.
I've made various attempts to manual add the slf4j dependencies to build.gradle (for Java) or build.gradle.kts (for Kotlin), and nothing I've done has made any difference.
I've also tried various different options for Spring Boot and Java version, and again it has made no difference.
Update...
I've confirmed that it only happens on one of my computers, my primary development desktop computer. My laptop is working fine.
I can't find anything that's different between the 2 IDEA installations.
Things I've tried so far to fix it...
Invalidate Caches / Restart
Manage IDE Settings -> Restore Default Settings
Removing and re-adding JDK's
Uninstalling and re-installing IntelliJ IDEA
I've tried everything I can think of to fix this, but the problem persists.
Basically I can't use logging in any new Gradle Spring projects. It just won't load the org.slf4j library.
Update 2...
The nature of the problem isn't exactly what I thought it was initially. It turns out the code compiles and runs just fine with the correct import, but the IDE is reporting it as unresolved.
So it seems it's just an issue with the IDE's intellisense. This seems less serious, but it's still quite inconvenient having the editor incorrectly showing errors.
After identifying that the problem was just with the IDE editor intellisense, rather than with the code dependencies or project, I was eventually able to resolve it by closing the IDE, and then deleting the system folder "C:\Users<user>\AppData\Local\JetBrains\IntelliJIdea2020.3"
After restarting IntelliJ IDEA, the folder was re-created automatically and the issue resolved itself.

Maven JavaFX Cannot find Main Class

I have some problems running my JavaFX8 Project with Maven. Here is the situation:
I create a Maven Java FX application within Netbeans (File --> New Project --> Maven JavaFX Application). Netbeans creates the packages and also creates a MainApp.java file.
Even if I don´t edit anything in this project, I get an error/warning within the properties.
Location: Right-Click Project --> Properties --> Run
Message: One of Run/Debug/Profile Project actions has been modified and the Run panel cannot be safely edited
The project can be built and run for some time, but after I create more packages, classes and stuff like that, I can´t run the application anymore.
It tells me, that it can´t find the Main class.
Message: Error: Could not find or load main class
I found some entries at stackoverflow and google, but none of the solutions seem to work for me.
I read this Topic for example.
One of the solutions is, to set the main class at the properties (Run), but all the fields are disabled. I also deleted the Cache, which didn´t solve the problem. I also checked the typing.
Some other sites stated, that it seems to be a bug, but they had older Netbean Versions. I updated my Netbeans version to 8.2 today.
The only solution at the moment is to create a new Maven JavaFX project and refactor the files to the new project. This works for a couple of hours but in the end the error occurs again.
Does anybody know a solution?
Use Run from the Project, not Run File from the main file. The latter can work on other setups, but not straight out of Maven.

IntelliJ SpringBoot dependency problems

I'm trying to follow several tutorials on how to use Spring Boot, however I keep running into issues where none of my dependencies are working properly. Below is an image displaying my problem.
I've tried making sure that I installed Maven correctly, however I imagine there is something that I'm doing wrong. I think that I have Maven in the proper Paths but, but I can't tell why it would still be providing the errors that it does. I've followed what it stated to do for Windows users, and have as follows.
Whenever I run mvn -version I am getting the following.
Can anyone help guide me in order to properly have Maven working on IntelliJ?
If you are using IntelliJ IDEA then I suggest using Spring Initializr which would create sample application with correctly configured maven setup is you choose Maven Project for Type:
http://blog.jetbrains.com/idea/2015/03/develop-spring-boot-applications-more-productively-with-intellij-idea-14-1/
Are you using Gradle or Maven to import required dependencies? If not, follow the guides here:
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/
If you have them setup, try to click one of the error and then click the red light bulb icon, see what it suggests you to do.

Adding existing source packages to a Maven Web Application in Netbeans

I have a normal Netbeans project, and I would like to add the source packages of this project to a project that is a Maven Web Application, also within Netbeans.
I tried copy-pasting the packages into the /src project directory of the Maven application, but this doesn't seem to work.
Could someone please tell me how I could do this ?
If this is not possible, could someone tell me if I can convert the entire normal project into a Maven Web Application ? Thank you :)
It sounds like you need to add the dependency to your web-application instead of the source code, cause maven is intended to handle exactly such situations.

Resources