Can not find symbol variable log - intellij-idea

IDEA2020.3Community
java1.8
java: cannot find symbol
symbol: variable log
Enable annotation processing---check
lombok plugin(newest 0.32-EAP)---check
maven/gradle dependencies(providedCompile group: 'org.projectlombok', name: 'lombok', version: '1.18.16')---check
Invalidate caches and restart---tried many times
no error/warning displayed, only if me building the project these errors pop up on build output
Why is this happening?

Actually, mvn compile solved my problem.

Related

Updated intellij messed up Kotlin with 'Check your module classpath for missing or conflicting dependencies'

Lot's of frustration here. I decided to follow the pop-up prompting an intellij upgrade so it'd stop nagging me.
And now I get a compiler error on certain parts of the code:
Cannot access 'java.io.Serializable' which is a supertype of 'kotlin.String'. Check your module classpath for missing or conflicting dependencies
I can make a new kotlin project with only the following and run it:
fun main() {
println("helloWorld")
}
But if I change it to the following it does not compile:
fun main() {
println("hello" to "World")
}
$ java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
I'm on windows. I find it very challenging to debug these kind of things. It feels very similar to this and this upvoted one
It was solved by downloading a jdk and applying it to the project:
Click the plus, select a vendor and download:
And then apply it to the project:
And rebuild.
I encountered some similar problem on IntelliJ and end up with clicking reload all maven projects button.
Invalidate Cache and Restart helped

Problem building project in IntelliJ 2020.1

I'm trying to build my project but I can't.
I get this error:
Error:Cannot run program "C:\tools\jdk8.0.191\bin\java.exe" (in directory "C:\Users\"my user"\AppData\Local\JetBrains\IntelliJIdea2020.1\compile-server"): Malformed argument has embedded quote: -Djava.endorsed.dirs=\"\"
Do anyone know what to do about this? Iøm trying to build in IntelliJ 2020.1
Best Regards
It might be related to more strict command-line processing in JDK on Windows after JDK-8221858 (private) security patch see this comment for details.
Try following workaround: Help -> Edit Custom VM Options action and add the following line at the bottom of the file: -Djdk.lang.Process.allowAmbiguousCommands=true and restart IDE.

`Error:osgi: [optaplanner-core] Unexpected build error` on building CloudBalancingHelloWorld

I cloned optaplanner's repository.
I imported the top-level pom.xml in IntelliJ IDEA.
Then I tried to run org.optaplanner.examples.cloudbalancing.app.CloudBalancingHelloWorld.
I get the following error: Error:osgi: [optaplanner-core] Unexpected build error
The doc says the maven integration will take care of the rest, so I guess I am missing something.
Question 1: Can I somewhat configure IDEA (or use the CLI) to show more verbose errors, so that I can debug it? Unexpected build error is not enough information for me to figure that problem out.
Question 2: How can I fix this error?
FYI, this box is running Ubuntu 18.04 (edit: exact same issue on Fedora 28). My maven version is as follows.
$ mvn --version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T04:49:05+09:00)
Maven home: /opt/apache-maven-3.5.3
Java version: 1.8.0_181, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-32-generic", arch: "amd64", family: "unix"
EDIT: IntelliJ version: 2018.2.1
Run configuration:
You should disable the Osmorc plugin in IDEA. After thay the project will normally build
Intellij IDEA's OSGI plugin chould not recongnized properties like parsedVersion.*, which was generate by org.codehaus.mojo:build-helper-maven-plugin added in parent project org.kie:kie-parent.
You should disable the OSGI plugin, or add following code to /pom.xml manually.
<properties>
...
<parsedVersion.majorVersion>7</parsedVersion.majorVersion>
<parsedVersion.minorVersion>28</parsedVersion.minorVersion>
<parsedVersion.incrementalVersion>0</parsedVersion.incrementalVersion>
</properties>
Drools and jbpm has the same issue, because they also use org.kie:kie-parent as parent project. It could be sloved by the same way.
i meet the same problem,and solve it later.
first,remove the osgi module in Project Structure->Facets .
then, change the Run/Debug Configurations as the project README.adoc said.
after all ,i can run it successfully.

Error while compiling the kotlin program in IDEA

I got an error while compiling the kotlin program in IDEA, as shown below:
Error: Kotlin: Kotlin home does not exist or is not a directory: D:\JavaProgram\JetBrains\kotlin.
What's the reason?
Try doing this.
killall java
./gradlew clean assemble
Also check this link

Kotlin - Error: Could not find or load main class _DefaultPackage

I followed the Kotlin tutorial for eclipse here : Getting Started With Eclipse Luna
However, I'm running into this error:
Error: Could not find or load main class _DefaultPackage
Anyone who knows to get around this?
This was a severe bug (KT-10221) in automatic generation of Launch Configuration in plugin version 0.4.0. It was fixed in 0.5.0 so the recommendend way to workaround is to update plugin.
The source of the problem was that the plugin used an old pattern for generating name of the class for main function that had been abandoned by Kotlin compiler.
It's possible to workaround it by editing launch configuration (Eclipse Menu -> Run -> Run Configurations...) by hand and changing Main class field in Java Application group. If the file is named hello.kt with no package directive, as it is described in tutorial, than corrected string should be HelloKt.
If file has name other.kt with package my.tutorial than the Main Class should contain my.tutorial.HelloKt. You can read more about it in the section Package-Level Functions of Calling Kotlin From Java page.
I have been getting the same issue. And after putting the right compiler output path, it got resolved.
Go to Project -> Project Compiler output :
In the text box, fill this:
[Absolute Path]/{Project Name}/out
In my case I was having this problem while trying to run the program using the Application Gradle plugin. The problem was in the mainClassName property using single quotes instead of double ones
This didn't work:
mainClassName = 'demo.HelloWorldKt'
With double quotes, it works:
mainClassName = "demo.HelloWorldKt"
For me it worked after I installed the correct JDK. I first had JDK 11 but the tutorial I did was with JDK 8 so after I installed this and set it in the "installed JREs" options it found the main class without having any "mainClassName" or any other option in the build.gradle file.
For me, it worked in a fresh eclipse workspace. Possibly, the Kotlin eclipse plugin is not playing well with other plugins (in my case, PyDev).
I'm creating a Kotlin Application with JavaFX and I had this issue until I went to:
Run > Run Configurations > Java Application > Common
I unticked "Allocate console" and it fixed the issue.