Eclipse Problems View doesn't show Errors

后端 未结 11 1940
[愿得一人]
[愿得一人] 2021-01-17 08:35

[Note: There is another thread about this problem but it did not answer the question.]

For one specific project in Eclipse, the problems view does not show errors. I

11条回答
  •  孤城傲影
    2021-01-17 09:27

    Here is the solution I use when the red icons do not appear on the project tree to highlight errors in our project files from Eclipse (Windows version).

    Make sure Eclipse is running on the correct JVM. By default, it will use the latest JRE classpath stored in a registry. If you need to run Eclipse from a JDK instead of JRE, you need to tell Eclipse. So, add the -vm option at the top of the eclipse.ini to refer to our preferred JDK as follows:

    -vm 
    C:\Program Files\Java\jdk1.7.0_21/bin/javaw.exe
    

    Remember to change this when you are upgrading your JRE/JDK.

    However, we may encounter issue with Maven complaining about tools.jar in a project's pom.xml. If Eclipse is running on Java JRE instead of JDK, it can be a problem to some Maven plugins like maven-bundle-plugin that still rely on tools.jar which only exists on JDK, causing it to complain. Don't worry about it if your still prefer to run Eclipse using JRE as you can put this entry inside your project's pom.xml to explicitly refer to the right tools.jar:

    
        
            default-profile
            
                true
                
                    ${java.home}/../lib/tools.jar
                
            
            
                ${java.home}/../lib/tools.jar
            
        
        
            windows_profile
            
                
                    Windows
                
            
            
                ${java.home}/../lib/tools.jar
            
        
        
            osx_profile
            
                
                    mac
                
            
            
                ${java.home}/../Classes/classes.jar
            
        
    
    

提交回复
热议问题