Create Maven Webapp with NetBeans based on Java EE 8 - java

I would like to set up a Java EE 8 Application with NetBeans 8.2 and Maven 3.2.2. In my NetBeans Wizard I can only pick Java EE 7. I checked my versions (see screenshots below) and everything seems to be with the JDK 1.8, so there should not be any problems.. Can anyone relate to this issue? I tried to follow this guide.

It is just an idea but maybe your JEE max version depends on the server you use.
Else, something is strange, when you ask for the maven version and the java version, it gives you two different version of java .
Hope this might help you :)

Related

Apache netbeans IDE 10.0 installed with JEE Support but annotations still as error

I have installed Apache Netbeans IDE 10.0 on Linux Mint, and followed this recommendation to activate JEE support ( https://superuser.com/questions/1404517/how-to-enable-java-ee-in-apache-netbeans-ide-10 ). I have restarted Netbeans and JEE annotations are marked as errors "Incompatible types : Path cannot be converted to annotation". This happens with all Java EE annotations, and I don't know how to solve this.
I have tried to do clean and build but still the same. Here is a screen shot of some sample errors:
You are having problems because the solution you followed for the accepted answer to the superuser question How to Enable Java EE in Apache Netbeans IDE 10 is wrong.
That answer advises you to use an Update Center to download some plugins used in NetBeans 8.2. That was an appropriate workaround on NetBeans 9, but wrong for NetBeans 10 since the appropriate plugins you need are already available (on the Tools > Plugins > Available Plugins tab), and you just need to install them. You don't need to obtain any plugins from any Update Center for Java EE, and doing so will probably be harmful.
See this SO answer to the SO question How to create Web Application in Apache Netbeans 10? for details on which of the available plugins need to be installed.
Notes:
I think you should first reinstall NetBeans 10 if possible, to start with a clean environment.
If that is not possible you should first uninstall those NetBeans 8.2 plugins you added to NetBeans 10, and then restart NetBeans.
Although the SO answer I linked to is for a slightly different question, the solution applies equally to your problem.
Although not related to your question at all, you might consider also upgrading to Apache NetBeans to version 11.1 if that is possible. If you did that you would still follow exactly the same process detailed in the linked answer for installing the Java EE plugins.

onelogin javasaml 2.0 in java6 project

I have a old project running in java 6 and am trying to implement sso using onelogin's javasaml library. I see the java-saml-core and java-saml dependencies compiled with higher versions. I also see that in the github that it is compatable with java 6,7 and 8. What does it mean? May i use the libraries as it is to develop my solution in java6 project? any thoughts? thank you!
https://github.com/onelogin/java-saml
Version 2.X of java-saml was originally designed to be compatible with Java 6,7 and 8.
but in the road we introduced some incompatibilities with Java 6 that we described on that github issue
Just in case someone is interested, I managed to recompile java-saml under Java 6 to run on an old WebSphere instance.
Changes are limited to a few Java 7 specific syntax (diamonds, multi catch, closeable)
Fork is available at: https://github.com/mguessan/java-saml

Add Tomcat 9 to eclipse

I have downloaded and installed tomcat 9 to my machine, but on Eclipse > Window > Preferences > Server > Runtime Environment, after clicking on Add, I see only Tomcat 7 and Tomcat 8, but not Tomcat 9.
What I have done:
1) installed tomcat 9 to local server;
2) updated eclipse to Mars (latest as of 2015-11-25);
3) installed eclipse "JST Server Adapters" and "JST Server Adapters Extensions"
Note:
My purpose of using tomcat 9 is it seems to be the only version that explicitly support java 8 and later, and my web app is using java 8. (http://tomcat.apache.org/whichversion.html)
I also have tomcat 7 exist in project but I also want to keep it in the machine, not to delete it.
Please see screenshot.
Please let me know about any config that I missed!
There are two things to note here:
Tomcat 9 is not released yet. Not a final version that is. If you check the official website, you will see that the only available version is an M1 version. Hence there is no support from Eclipse WTP for this early version. It will come soon, but not yet.
Tomcat 9 is not the only version that explicitly supports Java 8. If you check this page, you will see that "Supports Java version: 8 and later", which in this context means, that it officially support only Java 8 and above. It does not mean however this is the only one supporting Java 8. Theoretically you should be able to use any Tomcat version, in practice a Tomcat 8 will work perfectly well, since it support Java 7 and above. The majority of people with a Java8 + Tomcat combination are using Tomcat 8. Tomcat 8 also has Eclipse WTP support.
I was able to get the adapters for Apache 9 by installing Eclipse Java EE Developer Tools 3.9.4
Use a later version of eclipse e.g. Eclipse Neon.
It should work.
I tried all the above methods but still was unable to find solution for the problem then I did the following and that helped me to add Apache tomcat to my Eclipse IDE:
After following Help>Eclipse Marketplace and installing Eclipse Java EE Developer Tools 3.10 still tomcat was not available so I went to Help>Eclipse Marketplace>Installed>Eclipse Java EE Developer Tools 3.10>Change I put tick on the following and then I got the Apache Tomcat finally in my Eclipse IDE:
JST Server Adapters
JST Server Adapters Extensions
JSF Tools-Tag Library Metadata(Apache Trindad)
Git Integration for Eclipse
Use later EE version of Eclipse! Contains Tomcat adapters 8.5 and 9.0
I had same problem, but not now.
On my side, eclipse marketplace was stucked on previous WST server adapters.
I've used old update feature Windows > Install New Software
In main update site, I found Web, XML, Java EE and OSGi Enterprise Development part, where WST Adapters where ready to update ...
Eclipse MarketPlace often embed too much features & plugins.
On my own point view, easier to keep a light eclipse ;-)
Tested on eclipse 2020-09

Use different jre for projects and for eclipse launch

May be its a newbie question...
I want to use latest eclipse available. It requires Java 8. However, our company uses java 6 for all projects.
So:
Should I download eclipse that is compatible with Java 6 only ?
or I can configure Java 6 for all the projects regardless what eclipse uses?
Would there be any issues, if its possible to use two versions (one for eclipse and another one for project)?
I know its a newbie questions. But the search did not yield a proper response.
no, you can use the latest Java for Eclipse. The JDK used for project can be configured per project or per workspace. You can install as much JDKs as you desire. i.e. You can start Eclipse using a 32Bit JDK while using a 64Bit JDK for Java EE-Servers or Projects, it has basically nothing to do with the JRE used for Eclipse. You just need to set it up.

does sysdeo tomcat plugin for eclipse add value to helios?

am developing a simple web app using jsps and servlets for tomcat 5.5.
Currently using the Eclipse Helios and Dynamic Web Application Project.
For some reason it is a nightmare. We spent 4 hours today trying to deploy a servlet to tomcat. We kept getting errors like
"java.lang.UnsupportedClassVersionError: Bad version number in .class file"
we played around with everything trying to set the build compatibility to what tomcat had but couldn't make the stupid thing work. (Yes it is possible we're incompetent. any suggestions on what we can try looking at are apprecieated)
My friend recalls from long time ago that he used this plugin
eclipsetotale_tomcatPlugin
in order to create a "tomcat project". My question is, does sysdeo tomcat plugin add any features that aren't already available in helios?
thanks
Not sure about sysdeo, but your error seems similar to bug 116713:
If your default JRE is set to 1.4.2 and you have a Web project targetting
Tomcat 5.5 (dynamic Web module version 2.4 and Java 5.0), when you tried to run
a main program, you'll get the error (you mention).
What is your default JRE set for your project?
This scenario happens when the JVM running the code is older than the one the compiler generated code for.
Have you considered simply running Tomcat under Java 6? If that is not an option, please edit your question to include this and any other restrictions on this project.
We used to get that error often when we had Java version issues. Eclipse environment and Windows environment (java_home and path variables typically) are easy to overlook.
Also, you can use javap -v Foo in same directory as Foo.class to find out its version.
Just use the Eclipse IDE for Java EE Developers, 206 MB edition of Eclipse. It has Tomcat and other webserver support built-in by default. Works like a charm!
Sysdeo is an old, as far as I know obsolete, plugin.

Categories