Skip to content
Advertisement

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 provide a way to generate code to

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 relatively new to java, I do not really understand what Eclipse is trying to

Java version automatically change to java 1.5 after maven update

I am using eclipse as IDE. When I right click on the project and then click maven update my java version change to 1.5. Here is what I did so far, I followed all the steps listed here http://qussay.com/2013/09/13/solving-dynamic-web-module-3-0-requires-java-1-6-or-newer-in-maven-projects/ I changed “Java build path” to “workspace default jre 1.8.0_25” Then changed “java compiler” to 1.8 Then changed “project facets”>java>1.8 Changed

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 also belongs to the method. so, my question is, how

Advertisement