Reputation: 11285
I am getting the following error - sorry if this is fairly basic, I'm not super experienced with Java.
javac -cp "/Users/myname/Desktop/Projects/Project/build_dir/jarname.jar" filename.java
filename.java:24: error: cannot find symbol
@JsonDeserialize(builder = Builder.class)
^
symbol: class Builder
Ok, so far so good.
So I look into the code of filename.java, and see this on line 24:
@JsonDeserialize(builder = Builder.class)
So I've got a deserialize annotation, for the builder class (I think).
However, in the same file, filename.java, there IS a builder class:
@JsonPOJOBuilder
public static class Builder {
So what's going on here? Is it just that it's trying to compile and doesn't know to look for the Builder class too? How do I let Javac "know" that there is also a builder class?
Again, sorry if this is a basic question, but I'm not finding much information on the internet about it.
EDIT: As there's some question on how the application works, I'm including more code below:
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@JsonDeserialize(builder = Builder.class)
public class DetailClass {
private DetailClass(Builder builder) {
...
}
...
@JsonPOJOBuilder
public static class Builder {
...
}
}
So the Builder class is a method of the DetailClass as far as I can tell.
Upvotes: 1
Views: 1617
Reputation: 365
Looks like Builder is an inner class. To point to the inner class you should add parent class name before:
@JsonDeserialize(builder = Builder.class) -> @JsonDeserialize(builder = DetailClass.Builder.class)
Upvotes: 2