I moved my antlr4 based project which uses 6 different grammers to a different folder (and github depository). Now when I try to rebuild the Java project in I'm getting errors such as
Error:(30, 39) java: cannot find symbol
symbol: variable CharStreams
location: class com.applitools.ekb.PhpExtractInterfaceTool
even though the code includes
import org.antlr.v4.runtime.*;
and in a different grammar, it is even more explicit
import org.antlr.v4.runtime.CharStreams;
In the latter case, InteliJ (2019) colors CharStreams in red and says "cant resolve CharStreams"
All I did is copy the project over and all works as expected in the original project. I tried to unistall and then reinstall the antlr4 plugin - didn't help.
Related
I installed the project demo from here https://github.com/caprica/vlcj-javafx-demo and followed this tutorial exactly to install and run it in the latest version of IntelliJ on Mac: https://www.youtube.com/watch?v=yzmokfajN0o
But unlike in the video I get this error when launching the program:
Error:(39, 26) java: cannot find symbol
symbol: class PixelBuffer
location: package javafx.scene.image
The only difference seems to be I'm using Mac and in the video a pc is used. It clearly works as is since we see it running in the video linked above so the code cannot have any actual errors. There are no errors showing anywhere in the project for me either. If I search for 'PixelBuffer' using navigate class in IntelliJ it also finds it no problem:
I've spoken with the developer at length about it and he was as clueless as I am to why it would not work so if anyone can shed some light on this it would be great.
just started a migration java 8 to 11.
While in java 8, rt.jar and others were easily available, we used
import com.sun.security.auth.module.NTSystem;
Using java 11, my IDE (intellij) tells me:
Error:(3, 36) java: cannot find symbol
symbol: class NTSystem
location: package com.sun.security.auth.module
Any idea what I need to change?
If your module doesn't have module-info.java then the class NTSystem should be available. Otherwise, you can add requires jdk.security.auth to make it available:
module <module-name> {
requires jdk.security.auth;
}
Also, remember that IDEA is a smart IDE and you can press Alt+Enter on the error line to see a quick fix for the error. In your case, IDE will propose to add requires jdk.security.auth.
I downloaded/installed protocol buffers 3.1.0 and used protoc to compile a .proto file which generated a .java class for me.
With this change, everything works/compiles.
Then I replaced the avro jars with their latest versions and tried to compile my project again, but no luck, it's complaining this error:
# Compile: pregen/media.proto
pregen/media.proto/serializers/protobuf/media/MediaContentHolder.java:828: error: cannot find symbol
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
^
symbol: class OneofDescriptor
location: class Descriptors
pregen/media.proto/serializers/protobuf/media/MediaContentHolder.java:2669: error: cannot find symbol
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
^
symbol: class OneofDescriptor
location: class Descriptors
pregen/media.proto/serializers/protobuf/media/MediaContentHolder.java:4131: error: cannot find symbol
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
^
symbol: class OneofDescriptor
location: class Descriptors
3 errors
I did a lot search/research and still no luck, also looked at this most relevant post: Problems using protobufs with java and scala
and then I compiled my generated .java file along with protobuf.3.1.0.jar into a new jar and placed it under my lib/, but the project still cannot compile.
Any help on how to resolve this issue please?
(I'm using an open-source project to benchmark Java serialzation performance, and I've posted a more detailed question/issue there as well.)
One of the authors of that open source projects helped me resolve the issue, copy the solution here as well:
"The problem was that avro-tools-1.8.1.jar bundles some of the Protobuf
class files (ugh). The bundled class files aren't compatible with the ones
our generated Protobuf code relies on.
We're pretty fast and loose with what's on the classpath; we just include
"lib/*.jar". It would be nice to be more precise with dependencies at some
point.
But as a quick fix, I put avro-tools-1.8.1.jar in "lib/extra/", so it won't
get picked up by default. The Makefile now specifically references that
JAR only when we need to run the Avro code generator."
Thanks.
I am building Mopub SDK as a module using Intellij Idea.
I have copied test-assert-core-2.0M10.jar to libs folder under Mopub. However, when building it, the line import org.fest.assertions.api.ANDROID; shows red color at the word "ANDROID". Compilation error message says:
Error:(20, 31) java: cannot find symbol
symbol: class ANDROID
location: package org.fest.assertions.api
Have searched, but found nothing about this particular error.
Anybody using Mopub under Intellij Idea can offer some hint? Thanks!
I've found the solution. I deleted all files under /mopub-sdk/src/test, and it builds successfully.
I am trying to "Mavenize" our existing Commerce solution. However, I am getting a weird error when I try to run mvn compile I get the following error.
[ERROR] /home/user/tmp/IBM/WCDE_ENT70/workspace/WebSphereCommerceServerExtensionsData/ejbModule/org/ecommerce/wcs/changerequest/ChangeRequestAccessBean.java:[347,32] cannot find symbol
[ERROR] symbol : method createAccessBeans(java.util.Collection)
[ERROR] location: class org.ecommerce.wcs.changerequest.ChangeRequestAccessBean
When I check the class it is related to the com.ibm.ivj.ejb.runtime.AbstractEntityAccessBean class which IBM has neglected to include JavaDoc for anywhere. I look into eclipse and it shows me the method in question was correct using code complete, however, it still fails with maven.
I am wondering if it isn't a customisation to the IBM jre (I am not using that for this POC) and if there is no way around it (short of extending the class and reimplementing).
Anyone?
Problem had to do with multiple imports of different versions of the same dependency. Now this has been resolved.