Are javax packages stable? [duplicate] - java

This question already has answers here:
javax vs java package
(8 answers)
Closed 7 years ago.
Is it true that javax packages, in the Java language, are not stable and can be deprecated in future versions? In most of our project we use the swing packages which are included in javax.

This is nothing to worry about. There are Java classes that have been deprecated for the last 15 years but they're still in the core libraries for backwards compatibility.
Even if a whole swathe of javax.* classes get deprecated, they won't disappear.
You might want to take a look at Java 9's modular system too.

Related

Where did javax.xml.bind go in Java 9? [duplicate]

This question already has answers here:
How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
(43 answers)
Closed 5 years ago.
I tried migrating my project from JDK 1.8 to Java 9, but it wouldn't compile. My project uses a lot of javax.xml.bind.annotation classes and it seems they are missing. Were they moved somewhere or deprecated?
This is marked for removal( and moved to module java.xml.bind), you can refer to documentation here:
Java Docs API

How Java is Architectural neutral? [duplicate]

This question already has answers here:
What is the difference between "architecture-neutral" and "portable"?
(9 answers)
Closed 6 years ago.
I read that "Java is architectural neutral because it have the capacity to read the factor key of one processor into the factor of another processor."
Please explain me in detail the above statement?
Java was designed to support applications on networks.
To enable a Java application to execute anywhere on the network, the compiler generates an architecture-neutral object file format--the compiled code is executable on many processors, given the presence of the Java runtime system

Is it safe to compile againts later JDK? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have some big projects running on Java 6. But I plan to start building them in Java 8 since a lot of build tools have moved away from Java 6.
Is it safe for me to simply compile them with Java 8 and then deploy them in a web container running Java 8? If not, what are the considerations?
FYI, they don't have a proper automated test suite in place.
The problems can be related to:
deprecated methods that are removed in java 8 and you used in the old java 6 code
different behaviour for some methods:
There are aspects of the platform's behavior that are intentionally unspecified and the underlying implementation may change in a platform release.
configuration of web container that can be different from a version supporting java 6 and the version supporting java 8
external libraries that changed during the passage from java 6 to java 8 removing old methods so that your code can't compile
So yes it is possible that the passage from java 6 to java 8 can broke your code.
But if the code compile it is quite sure that the behaviour of the code is the same, because generally (but not always) a retro compatibility is granted. You can be sure of that only running a complete set of unit tests both on java 6 and java 8 versions.
Here some example of not compatibility between java 6 and java 7:
JDK-6527962 : Retire the non-standard package com.sun.image.codec.jpeg. If your code use this package the it doesn't compile on java 8
JDK-6563734 : Path2D.Float and Path2D.Double should have final getPathIterator methods If your code ovewrite the methods declared final the code will not compile passing to java 8
Here a complete official list of incompatibilities between java 6 and java 7
Here a complete official list of incompatibilities between java 7 and java 8
It usually should be, since most of the features are backward compatible. However, there are no guarantees. Please do follow the proper process and do testing before rolling out to production.
For web container , with jdk, version would also have changed. This may cause some problems depending upon the software vendor and what all services you are using from the container ( JNDI, connection pooling etc).I once had a problem in migrating application to higher version of JDK. We also upgraded Websphere. We were using JSF, and higher version of WAS had JSF jars included, which was clashing with our application jars.
Your apps may be using a lot of 3rd party library which may be impacted. Again, mostly you should be Ok, but there can be small issues. Without knowing your applications, I can only suggest migrate and test to confirm.
You need to test things very thoroughly. If there are bugs, then it is imperative to find them and fix them before you move on to the next version. If you have a sunny day scenario and do not have bugs coming from the upgrade, then at least you know that for sure after the testing.
However, you need to know what to focus on. You need to read about changes applied on version 7 and on version 8.

Where can I see the definitions of native methods in java? [duplicate]

This question already has answers here:
Is the source code of native methods available?
(2 answers)
Closed 8 years ago.
Using eclipse, I see that methods like System.nanotime() or System.arraycopy() are native.
However I could not see the definitions of these methods.
Where are can I find the definitions , and more importantly what language are those methods written in ?
Install the Java SE Development Kit from http://java.sun.com/javase/downloads/index.jsp.
Once installed, you should find an archive called src.zip in the top of the JDK installation directory. The Java source code is in there.

Get java version that was used to compile class [duplicate]

This question already has answers here:
how to check the jdk version used to compile a .class file [duplicate]
(5 answers)
Closed 9 years ago.
Is it possible somehow to get java version that was used to build class? Is there are any information compiled into class file? Possible there is some specific headers/footers or something like that.
Yes. You can find the version of JDK on which the class was compiled. Refer here.

Categories

Resources