Java EE 6 backward compatible to Java EE 5? - netbeans

We have a Java EE 5 project developed using Netbeans 6.7.1 with Glassfish v2.1. Trying to open this project with Netbeans 6.9.1 with Glassfish v3.1 there are many errors concerning missing types.
Is Java EE 6 backward compatible with Java EE 5?
The missing libraries generally revolve around:
javax.xml.rpc.ServiceException;
javax.xml.rpc.Stub;
org.jvnet.staxex.StreamingDataHandler;
com.sun.xml.ws.fault.SOAPFaultBuilder;
Any ideas?
[Update]
It seems that not all of the required libraries are being added to the classpath for a Glassfish 3.1 project automatically. The main missing jar is jaxrpc-api-osgi.jar under glasshfish3/glassfish/modules/. If I add this jar manually all the problems go away. Why would this be the case? Why isn't the jar added automatically as is done using NetBeans 6.7.1 with Glassfish 2.1?
[Update]
I managed to hunt down org.jvnet.staxex.StreamingDataHandler; and com.sun.xml.ws.fault.SOAPFaultBuilder; via:
com.sun.xml.internal.org.jvnet.staxex.StreamingDataHandler;
com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
Looks like some package changing went on. Still, this doesn't fix my problem with javax.xml.rpc.Stub; and javax.xml.rpc.ServiceException; not being added to my classpath correctly. I don't feel it's right to add the jar manually.
Wulfgarpro

Nothing is ever completely backwards compatible, but having those classes not showing up at all is suspicious. At least the first two are definitely in Java EE/Java 6. If there were incompatibilities I'd expect something like parameter mismatches or methods not found.
First place I'd look is at the Netbeans project setup -- I'd bet a small amount of money that your classpath.search path doesn't include something you need.

javax.xml.rpc is present in both EE 5 and 6. So this can't be about API version incompatibility. There must be a problem with the way your Netbeans project is set up.

I fixed the problem by uninstalling all JDK, JRE, and NetBeans. Reinstalling, the issue was rectified.
WulfgarPro

Related

Can't get the delegate of the gradle IncrementalProcessingEnvironment in STS 4

Since I installed the Spring Tool Suite 4 I get on every class definition the warning
Can't get the delegate of the gradle IncrementalProcessingEnvironment.
I do not use gradle for building my project but maven. So, why is there a need for the gradle IncrementalProcessingEnvironment? How can I get rid of these warnings?
Looks like this got reported here, too:
https://github.com/spring-projects/sts4/issues/95
And looks like this is related to Lombok being installed and used within Spring Tools 4 for Eclipse. Since Lombok is modifying the underlying Eclipse code quite a bit when installed, I wonder if Lombok is already compatible with Eclipse 4.9 (2018-09), which is used in the Spring Tools 4. It is not more than a wild guess, but I assume the problem is related to that.
It also looks like something like this already got reported to the Lombok project: https://github.com/rzwitserloot/lombok/issues/1813 - and people report that the Edge build of Lombok works better or even fixes the issue. Would recommend to give the Edge build of Lombok a try.
try change sts path lombox version same to maven dependency lombox version
double click dependency lombox.jar select ide sts.exe (i did ok)

Netbeans 8.0 - import older projects

Newly installed Netbeans 8.0 does not recognize my projects previously build in Netbeans v6.9.1. How do you import these?
Do you have old projects in some folder?
Copy this projects to C:\Users\User\Documents\NetBeansProjects
In Netbeans File/Open Project
Select your project
It looks like you've installed the NetBeans for Java SE without NetBeans for Java EE. You need the NetBeans for Java EE bundle (second column from the left) for all the web projects.
In my case I was using Java EE in one project, PHP and Zend in another. These projects needed plugins to work. I went to
NetBeans -> File -> Open Project
and my projects were listed even though they didn't show up in the Projects file browser. Each project's name was
<unrecognized project; missing plug-in?>
so I went to
NetBeans -> Tools -> Plugins
there I installed PHP, Zend and Java EE. I restarted NetBeans and everything worked fine.
This thread was useful to me:
http://forums.netbeans.org/ntopic17656.html
Once, I tried to install the Java SE Download bundles for Netbeans ( Was like mistake in clicking the Download option) but I was suppose to go for Java EE. SO, I was facing problem to import my previous Java EE Netbeans Project since I was in JavaSE Environment. Maybe Importing plugins for Java EE /Web or few more configuration would work for
that case but I was seriously stuck for a long time.
The Error was like :
<unrecognized project; missing plug-in?>
So, What I did was simply uninstalling Java SE Netbeans and installing Java EE one and my older project was easily imported. So, seriously you might need to care about the download bundles or the installed plugins but Netbeans is mostly good for importing / Exporting.

headless AJDT build fails when upgrading java from 1.6 to 1.7

strong texti have a very simple eclipse 3.8-based rcp application with an .aj file. i also have AJDT 2.2.1 installed, and have the following four entries in my build.properties:
javacSource=1.6
javacTarget=1.6
compilerAdapter=org.eclipse.ajdt.core.ant.AJDT_AjcCompilerAdapter
sourceFileExtensions=*.java, *.aj
i am using a headless build approach via Ant, and it has been working like a charm, AJDT and all, while using java 1.6. but once i upgraded from java 1.6 to 1.7, and changed the two aforementioned build.properties entries' -- javacSource and javacTarget -- values from 1.6 to 1.7, i got a boat-load of build errors, all with the following suffix:
... are only available if source level is 1.5 or greater
setting build.properties' javacSource back to 1.6, while leaving javacTarget at 1.7 works. or if i were to comment out the two AJDT-specific entries from my build.properties, while leaving javacSource and javacTarget values at 1.7. the build completes just fine as well. so my guess is that AJDT compiler is somehow the culprit. the question is why and what can be done to resolve it.
thank you for your time!!!
It sounds like one of two things:
Your AJDT installed does not have an AspectJ in it that is compatible with Java 1.7. What AspectJ version are you building with? Note that this aspectj version may be different from the one in your target platform.
You are not correctly specifying the Java source/target version in a way that AspectJ can recognize. How are you specifying the Java source/target version?

Which JRE version to use while making new Java Project in Eclipse and what are the drawbacks?

In Eclipse when i create new Java Project, i see options like:
Now i want to know, what is the safest option to use considering when i export jar file any user will be able to use it. If selecting the shown option, does that mean if someone has JRE 1.6, he will not be able to run that jar file, or is it backward compatible??
As such my project has no specific 1.7 dependencies.
This is very broad question, which JRE to use depends on your requirement. If you have multiple projects, each specific to a JRE, then you can use project specific JRE. If you are happy with eclipse default JRE you can continue. It is purely your decision.
Someone with JRE 1.6 should be able to run on 1.6 as long as compilation level is set to 1.6 (This may flag if your code has any 1.7 features which are not part of 1.6).
If you use features which are specific to JDK 7 (such as the new NIO.2/The path API ) then they most likely won't work on java 6. Furthermore Java 6 has been tested and withstood the test of time as a result most (if not all) bugs have been ironed out. Java 7 is still fairly new and even after it was released there was a pesky bug that showed up couple of days after release which had to the with the loop optimisation. So unless you specifically need JDK7 features I'd suggest you stick with JDK6, on the other hand if your project is not mission-critical then you might experiment with the new JDK7 features given that your user base has JRE 7. Just my 2 cents...

Why do I still get errors using a switch statement with strings in Java SE7 on Lion?

I am running Mac OSX lion and have a Java project in netbeans where I would like to use string switch statements. I downloaded and installed the OpenJDK7 and I think I have configured the project to use the Java 1.7 properly.
In the Project Properties I have set JDK 7 to the platform:
It is showing up as JDK 1.7 in the Libraries section in the Projects Window.
However, I still get a compilation error saying that switch with strings is not supported in 1.6
Am I missing a step here?
To fix this, I followed the very comprehensive tutorial from the netbeans website found here:
http://netbeans.org/kb/docs/java/javase-jdk7.html
Specifically I had forgotten to set the Sources/Binary Format to JDK 7. You can do this in the bottom right of the Sources section of the Project Properties window.
If it's anything like Eclipse, the string case is a language feature, not a library feature.
Eclipse uses its own internal compiler by default and I suspect NetBeans is similar.
So you have to ensure you're using a JDK7 compiler. From a cursory search, the project settings should allow you to set an external compiler.
Are you using 7.0.1 or greater?
NetBeans 7.0.1 provide a hint if you have a chained if-else statement to take advantage of the JDK7 features. Have you downloaded it yet ? Check out screencast #35 highlighting Project Coin features in NetBeans. NetBeans 7.0.1 provide complete tooling around JDK7 and GlassFish 3.1.1 allow you to leverage JDK7 features in your Java EE 6 applications.
http://blogs.oracle.com/arungupta/entry/totd_168_string_switch_statement
Here are some steps:
Select the project you want to change source settings for.
Got to File > Project Properties...
Select the Sources Category.
Change the Source/Binary Format dropdown to whatever format you want to use.
Viola!