Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have JDK 8 installed in my ubuntu 18.04 system and I now want to upgrade it to JDK 11 using this. I just want to know if this would create any problem or not. Would the older version be removed on upgrading( Actually I want older version to be removed by itself)?
Do this to uninstall previous versions of openJDK on Ubuntu
sudo apt-get remove openjdk
To remove all of the config files and dependencies.
sudo apt-get purge --auto-remove openjdk*
Then install openJDK 11
sudo apt-get install openjdk-11-jdk
An upgrade will generally allow code compiled for Java 8 to run; but, there are some caveats.
The inclusion of Project JigSaw means that the access rules for "reaching" a method have changed slightly. They are almost compatible between Java 8 and Java 11. The differences will show when:
You try to use one of the com.sun.* packages (or any other non-public api entry point).
You try to use reflection on a non-public API entry point.
You alter the launch to use a module, which will deactivate the Java 8 "default" module handling.
In short, it's almost an easy upgrade. The problems come into play when code is doing something it shouldn't have done, or when you have code not designed for modules, and some of your runtime code is designed for modules.
If you have access to source code, you can fix a lot of this by adding in the module specifications; but, that might require you to understand modularity (which is pretty easy, but a barrier nonetheless).
Related
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 4 years ago.
Improve this question
We want to migrate all our production services to Java 10 from Java 8. As I understood, we might face issues with builds (gradle etc.), dependencies etc. for development. But when it comes just to the JVM itself, i.e. running services, will we face any issues if we just install JVM 10 in production to run our jar services?
I'm not sure why this has been downvoted since it seems a reasonable question.
Oracle's own guidance for moving applications from JDK 8 and earlier to JDK 9 and later is "applications that just use java.se should just work". If you have not used (directly or indirectly via a third-party library or framework) any JDK internal APIs (sun.misc.Unsafe is the most infamous) then you can leave all your application code on the classpath and this will most likely work without change. There are a few differences that might catch you out with changes to things like command line flags.
I've written two blogs on this, which might be helpful to you:
https://www.azul.com/jdk-9-pitfalls-for-the-unwary/
https://www.azul.com/jdk-10-pitfalls-for-the-unwary/
You should also bear in mind that it doesn't make any sense to migrate to JDK 10. JDK 11 will be released next month and, at that point, updates for JDK 10 will stop. It would be better to migrate to JDK 11. If you're looking for long-term support Oracle is now charging for this. Check out our Zulu OpenJDK builds.
A good starting point is the JDK Migration Guides on the Oracle download site. The JDK 10 Migration Guide covers migration from JDK 8 to JDK 10 and can be found here:
https://docs.oracle.com/javase/10/migrate/toc.htm
Another good resource is the JDK release notes as these include notes on the known source, binary and behavioural compatibility issues. You can find the release notes for the JDK 9 and JDK 10 releases linked from here:
https://www.oracle.com/technetwork/java/javase/jdk-relnotes-index-2162236.html
Another resource is the videos from conferences. I've prepared several times on the topic of migrating to JDK 9 and beyond. A recent one from Devoxx BE 2017 can be found here:
https://www.youtube.com/watch?v=uSR5JroBp34
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.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
Should I always use the latest JRE version of Java 7 for a ubuntu production server ? Or should I be careful while upgrading between these minor versions too ?
Does the same rule apply to while making a choice between minor versions of Tomcat7 server?
I'm asking this in context of making a choice only amongst the minor versions of Java 7. Also please mind I'm asking this for a PRODUCTION server so I need extra carefulness.
This is a security issue; the minors are almost always security updates. Use the latest of whichever JRE (Oracle, OpenJDK) you choose.
I would suggest you to use the latest one, but at the same time, i would suggest to move your updates first on a stage server , test them thoroughly be fore moving to production. This is because, many time the project code uses library/jars who are compatible only with certain version of JRE, and upgrading JRE version might break them. So, either you need to update those library /jar as well or you live with current JRE version.
If those jars are not being maintained, you may be out of luck.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I 'm use to work with Netbeans 7.2.1 on ubuntu 12.04.
Since the update on july 24, it's no more possible to create projects with it. That comes from the update of the openjdk, as mentionned on this topic.
The more convenient solution seems to use oracle-java instead of open-jdk. Hopefully, there are plenty of docs explaining how to switch from one to the other.
Nevertheless, I encounter an issue while trying to install oracle-java7 on my ubuntu.
In a terminal I type in sudo apt-get install oracle-java7-installer
Up to there, everything is going well, but then, the connection to edelivery.oracle.com fails because timeout expires
I'm behind a company proxy, so I assume the problem may come from that. But I'have no clue how to resolve that.
I have Linux Mint, I don't like relying on apt to have Oracle Java, so I did this:
Download the JDK from the Oracle website.
Unpack it in /opt/jdk_17
Create a link from /opt/jdk to /opt/jdk_17 (so every time I update the JDK I just need to update the link)
Add JAVA_HOME=/opt/jdk in /etc/environment
Update (or add) PATH to include /opt/jdk/bin
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
i'm using Netbeans on Ubuntu, when i write top command i notice that Java causes like 100%+ cpu usage. Is there anything to do to speed up Netbeans ? can i download another JRE on ubuntu to speed it up (i'm using OpenJDK).
Thanks .
Another item that helps me, apart from replacing OpenJDK with SunJDK is the "Scanning Sources" which can be disabled if you goto Tools -> Options -> Misc -> Files and uncheck the Enable "auto-scanning" of sources.
I am not 100% sure what that option does, but it speeds up my projects. Also I would try NetBeans 7, they have made massive leaps and bounds in the newer versions from the older (not knowing what version you are using).
Yes, it's well known that Netbeans runs slower with OpenJDK.
Your question has been answered on AskUbuntu before:
https://askubuntu.com/questions/5567/how-to-install-the-sun-java-jdk
Enable the partner repository and then install Sun Java with:
sudo apt-get install sun-java6-jdk
I would:
Replace OpenJDK with Sun's JDK. OpenJDK's performance is still not upto par.
I would read this (a bit dated, but most of works with some changes).