Skip to content

Tag: eclipse

Automatically create builder for class in Eclipse

Is there a way to use an automatic builder to create builder (Joshua Bloch’s Builder Pattern) for classes in Eclipse? For example an option in the menu, a plugin or something else. I could not find anything under “Refactor”. Answer Maybe I am late to the party. Eclipse on its own does not pr…

java swing component cannot be resolved

I took the following code from a tutorial: The f.add(l); is highlighted and two errors are shown: The method add(Component) in the type Container is not applicable for the arguments (JLabel) The type javax.swing.JComponent cannot be resolved. It is indirectly referenced from required .class files Being relati…

Spring Boot Program cannot find main class

I have a program which runs as a Spring boot App in eclipse. The program was running fine. Then i did the following: Right click on project -> Run As -> Maven Test . This was accidental. When i then tried to run the program as a spring boot app again, it threw the following error below. Error: Could not

get line number of a MethodDeclaration

I’m trying to create a parser of Java files, but I can’t get the correct line number of each method. this is the code that I’ve right now: imagine that we’re parsing the following class the code instead of returning 6, returns 3. apparently the eclipse.jdt API considers that javacode a…