Why doesn't my java compiler level match my installed project facet? - java

I made a simple Java Google AppEngine application called Guestbook in Eclipse 3.7 and am trying to run it. However, I am encountering an error that lacks a quick fix:
Description Resource Path Location Type
Java compiler level does not match the version of the installed Java project facet.
Guestbook Unknown Faceted Project Problem (Java Version Mismatch)
I tried navigating to Project | Properties to change my project facet. However, I could not find a setting that dealt with "facet."
What does "installed Java project facet" mean, and how do I fix this?

You can see your facets via Right click on your project->properties->Project Facets,
Here you can see my facets for an example web application:
I think your Java facet does not match with the installed one. I'm suspicious that facet is at version 1.5. Please check it.
Add-on:Open the Navigator view, expand the .settings folder, open the file org.eclipse.wst.common.project.facet.core.xml and manually set the Java version to 1.6.

Right click on your project->properties->Project Facets,
This will show your current version of java for your project facet.
In my case I had the correct version for my facet but not my compiler,
So had to right click on project->properties->Java Compiler
Then under Compiler compliance level drop list and change to version of project facet.

its simple.. in Problems infotab, rightclick on error desc and select quickfix... choose facet version upgrade..

I got this issue in IBM RAD tool eclipse It got resolved following below.
Right click on project
Properties
Project facets
Configuration (select Default configuration for WebSphere application server v7.0 )
Apply

Related

Eclipse building the project with a different JRE than the one provided in java build path

I am new to eclipse and trying to run a spring application with a number of modules. I am setting the build path and compiler to use jdk 1.8 but when I run maven install it is building the project using JRE 1.5 for all the modules somehow. I checked the pom.xml but no where the compiler version was defined. I wanted to know if anyone can help me with the reasons why I may be facing this issue.
If you want to make sure that newly created projects in Eclipse use another default java version than Java 1.5, you can change the configuration in the maven-compiler-plugin.
Go to the folder .m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.1
Open maven-compiler-plugin-3.1.jar with a zip program.
Go to META-INF/maven and open the plugin.xml
In the following lines:
${maven.compiler.source}
${maven.compiler.target}
change the default-value to 1.7 or 1.8 or whatever you like.
Save the file and make sure it is written back to the zip file.
From now on, all new Maven projects use the java version you specified.
Information is from the following blog post: https://sandocean.wordpress.com/2019/03/22/directly-generating-maven-projects-in-eclipse-with-java-version-newer-than-1-5/
More Link : Why Maven project is tied to J2SE-1.5 by default?
What causes imported Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn't?
Right click on the project . Go to "Properties" . Select "Java" in the left pane, and choose "Installer JRE" . See which JRE is pointed to . If you want , change it to your desired jre. If that is in correct configuration, then choose "Compiler " option under "Java" and check the Java version used. If it points to 1.5 , override it to 1.8 and check again .
So In anyone of these places , java might be pointed to 1.5 .
If all the above are good , check the java path in environment variables and check if it points to 1.5 or 1.8

Why I am not able to run a dynamic web project on JBoss AS 5.1 with correct project facet in eclipse

I am on Ubuntu 14.04, using eclipse Luna 4.04, Java 7 and Jboss 5.1
When I created jsp file I am getting this error
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
I know the solution of this error that I need to select the target runtime jboos 5..1
but when I go to
properties->Targeted Runtime
the jboss5.1 is disable.
how do I resolve this
after adding the target runtime not able to run the project
Server tab
console after starting the server
Project facts
You need to add the server runtime libraries on your build path.
Right click on the project
Click on Build path
Go to the Libraries tab
Click on "Add Library"
Select Server Runtime
Select the installed JBoss Server runtime
If proper runtime is not enabled, change the project facet
Right click on project
Properties
Project Facet
Select Dynamic web project or appropriate facet for your project.
Check the java version, java version should support your application server.
Set the java version as 6 for JBOSS AS 5.1, its not supported by Java 7.

Dynamic Web Project - Project Facets not displaying CDI as a project facet

I'm trying to add CD,I as a project facet to a Dynamic web project. But when clicking on the project facets view there is no CDI option in the Project Facet list as you can see:
I tried following this suggestion in where they said to erase possible conflicting jres, and also the suggestions in here which recommends checking the installed jre's, my view of installed jres is:
I'm at linux mint so I'm also attaching a screenshot of the dir /usr/lib/jvm, in case you guys see any anomaly in it and also it seems my java version is okay:
Did you installed JBoss Tools?
Go to Help -> Eclipse Marketplace find JBoss Tools for your version of Eclipse (To check version of eclipse go to Help -> About Eclipse)
Then select plugin you need
UPD
And also check Runtime Environments (window -> preferences)
Eclipse should be restarted after installation

Get the JDK version which is eclipse using to compile my current projects

I want to know which JDK is eclipse using to compile my current projects.
Is there a way to know that from eclipse itself.
Eclipse has its own Java compiler, it does not use the JDK compiler.
The 'Preferences > Java > Compiler' preferences set which language level the Eclipse compiler uses.
You can also override this for individual projects in the 'Java Compiler' Property page for the project.
The 'JRE System Library' setting in the 'Java Build Path' properties for a project determine which JRE is used for the Java system library Jar files.
Open the project and look next to its JRE System Library folder to see the version. For example in one project mine is JDK1.7.0_51. If that does not work, then right click on the project name, select Build Path/Configure Build Path and see the configured JDK version in the window that pops up. Each project can be independently configured to use a different JDK, but one of them is the default and that can be configured in the Configure Build Path app.

Can't locate JDK x64 in intellijIDEA

I am starting a new project, and the client requires us to work in IntelliJIdea. I installed it and tried to do the ant build. It turns our I need 64 bit jdk for the build. So I installed it. Now, however I need to configure it in IntelliJIdea. Here is the message I get:
JDK (1.6_x64) needed to run this ANT target is not configured. Please
update your settings in the Project | Libraries menu.
Can somebody help me locate this Project | Libraries menu menu please?
Press ctrl+alt+shift+s, and on the left hand side you'll see Project Settings -> Libraries.
Q: Where do I configure project JDK?
A: In the Project Settings dialog.
To add a JDK to project, press Ctrl+Alt+Shift+S, under Platform
Settings click JDKs and specify JDK path. After that, you can click
Project and specify which of JDK you have configured is used in the
current projects. Remember that JDKs are configured at IDE level, so
when you create another project, you won't need to add the same JDK
again.
reference :
http://www.jetbrains.com/idea/documentation/migration_faq.html

Categories