I tried adding the androidx.compose.material3 package to my default "Compose for Web" Intellij project using Gradle but it throws an error during build saying that Material3 requires an older version of androidx.compose.annotations (which I guess is imported as an dependency of androidx.compose.web). So I was wondering if that means that it still isn't possible to use Material widgets to build web applications using Kotlin+Compose (kinda like in Flutter)? If it is possible, how should my build.gradle.kt look like?
I've already tried using both the template from Intellij and the template on Compose's GitHub repo but they both throw build errors when importing Material3.
Related
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.
To translate my RCP App. I would like to use fragments. I have followed this tip from vogella.com to translate SWT and JFace and it worked very fine.
Now I would like to translate workbench. Using the same approach, I have created a fragment project, and put properties files along with their packages extracted from related babel project: org.eclipse.ui.workbench.nl_XXXX.
The properties files are located inside packages named equally to the ones in the host plugin
I've added a fragment to the RCP feature project
I've added a fragment to the launch configuration
But it doesn't work!
Does someone have any idea what I'm doing wrong and if my solution is the right approach?
Eclipse workbench translations can be obtained from the Babel project, including fragments for SWT.
Unfortunately, it seems that at least for the Oxygen release the SWT fragments do not (yet) contain the actual properties files with the translated messages.
However, SWT provides its own translation fragments, that can be obtained from http://eclipse.org/swt/language.php
Note that the Babel project is mainly a community effort and since Oxygen is relatively new, it might take some time for the language packs to catch up with the latest release.
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.
I would like to add a new button here that creates a project with the SBT build system. How do i go about adding a project type in this menu?
Menu image found below
fabric8 project type picker
There are 2 options really
create a maven archetype (as in a tarball of stuff you wanna use as the basis of new projects); the tooling will then just work with your archetypes.
Note that the use of maven archetypes is just a way to package sample projects - it doesn't really matter how you build them. e.g. we use maven archetypes to create lots of different projects not using Java (Swift, Node JS, .NET etc)
If you have a sample project and don't mind sharing, we could clone it into the fabric8-quickstarts organisation & it'll get automatically included in the console in the next release
create a JBoss Forge addon. If you wish to create a custom wizard to create new projects using SBT, you can add a new addon to JBoss Forge and we (or you) can then install it into the fabric8-forge docker image
I'd like to create my own gradle library, that can be compiled into other projects using gradle compile statement.
Example from Picasso's README:
Download the latest JAR or grab via Gradle:
compile 'com.squareup.picasso:picasso:2.5.2'
I'm developing few applications that share common source: fragments, views, some logic... Sometimes I extend these sources while I'm developing app A, sometimes while I'm developing app B,... And I feel that copy-paste of packages/classes in Android Library Module is not an proper solution.
So I would like to setup my own library, that:
it could be easily deployed to as gradle library that could be used by compile.
I can easily develop/extend it together with currently developed application
Disclaimer: I had been googling it a lot, but without luck.
If you want to reuse a library across completely separate projects then you'll want to publish your library to repository. Assuming this is open source and you don't mind sharing, you could use JCenter, which is already added as a repository to Android projects by default.
https://www.virag.si/2015/01/publishing-gradle-android-library-to-jcenter/