Mixing Java 6 and Java 8 in one setup - java

I have multi-aplication system based on Java 6. Each application runs on own Tomcat server installed on one or more hardware servers (linux). Applications using Hibernate (3 and 4 - not unified so far), Spring 3.x. Applications implements Hessian API to communicate each other.
I'd like to migrate one application to Java 8 but only this one. This application is in early developing state so I can do it easily.
Is it possible in my case to mix both Java 6 and Java 8 applications on one target installation? If so, what is important to take care during migration and further development?

The Java platform strongly upholds its promise of backward compatibility. You should have no problem running an application developed for Java 6 on a Java 8 runtime.

Related

Custom JRE with Java EE(Jakarta)

After added the great feature of Java Module that can run custom JRE for specific application developed and Jakarta for develop the web application or enterprise application which can run Jakarta 9 , I can't understanding method to create web application with java! the question is if I need java 11(or 8) to create web application and Jakarta 9 do I need the Custom JRE that create with module ?
No, it is no required. Actually, the spec is silent in the way or application is deployed.
Currently, there is no more concept of JRE, using newer JDKs, only JLinked images, where you can select only the modules you need.
For now, only Java 8 is supported officially, with support for Java 11 coming shortly.
The specification doesn't mention anything about the Java module system. However, if you want to use modules, you could that a look at the Piranha Cloud project.
https://piranha.cloud
[Disclaimer: Piranha Cloud developer here]

Has there different JDKs or JVMs on each Java platforms? [duplicate]

This question already has answers here:
Difference between Java SE/EE/ME?
(14 answers)
Closed 6 years ago.
I am confused about java platforms.From the page Differences between Java EE and Java SE , java has four platforms. Has there any special things between them ? Are they use different JDKs or JREs ?
For clear my question , when I download JDK , I think I can create not only java desktop applications (with swing or javafx) but also web applications.If so ,why java says it has different platforms. If yes , it should has different jdk or jvm for each specific platform. As I think , different platforms mean I need to download different version of JDK. For instance , I need to download JDK for JavaEE platform which contains API for JavaEE.
It depends (like often).
The JDK is a development kit for Java SE including FX. So you can develop desktop applications but also web applications depending on the type of integration you prefer. The Java EE SDK contains also the Glassfish server, examples and tutorials but they are not really needed. The ME is a special minimized versions for embedded device development including special tools for that.
I am developing web application for years with a Java SE JDK only. As I normally use Spring Boot with an embedded container or install a Tomcat on demand, this works perfectly and the Java EE SDK is not needed.

Researching for application server supporting Java 8

I am currently trying to find an application server where I could deploy my Java 8 projects. As far as I am aware, due to a bug in Glassfish 4.0 it is not possible to run any Java 8 projects on it, and Tomcat supports Java up to Java 1.7. Are there any other possibilities I am not aware of?
Wildfly 8 supports running on java 8's JRE (don't be confused by downloads page saying "Java EE7", this is about EE spec implemented).

Compiling using Java 6

Many of the users of my Java applets/applications don't have Java 7 installed (about 80%, surprisingly). If I compile my programs with Java 6,
Will the Java 7 users be exposed to the security vulnerabilities in Java 6?
Will my applet/application work with Java 6 and 7?
Are there any disadvantages? I am not really using any of the new Java 7 features (except the diamond operator which is easily fixed).
Will the Java 7 users be exposed to the security vulnerabilities in Java 6?
AFAIK, It's Java 7 which has the most serious security vulnerabilities. How you compile the code doesn't matter, only what the code does and which JVM version you use.
Will my applet/application work with Java 6 and 7?
If it has not bugs, yes. If it has bugs, it is most likely to do the same thing on both, but possibly not. i.e. it might be that a bug appear in one version but no the other or in different ways on different versions.
Are there any disadvantages? I am not really using any of the new Java 7 features (except the diamond operator which is easily fixed).
The disadvantage is just that you cannot use the new syntax or the new Java 7 libraries.
How the code runs or performs is not changed.
Security flaws have been discovered with both Java 7 and Java 6 when running in browser sandboxes; i.e. when running applets. The most recent one was Java 7 only, but previous ones have applied to Java 6 or multiple versions.
The problem is that people who run your applets need to have Java enabled in their browsers. And that makes them vulnerable to attack by people planting bad applets; e.g. on hacked 3rd party websites.
The best security advice we can give to users is to disable browser Java because of past and potential future vulnerabilities. (On some platforms, a complete uninstall is advisable). These measures will have the side-effect of rendering your applets useless.
IMO, you should be removing your applet functionality entirely rather than trying to make it work with multiple Java versions.

What's the main difference between Java SE and Java EE? [duplicate]

This question already has answers here:
Difference between Java SE/EE/ME?
(14 answers)
Closed 7 years ago.
What's the main difference between Java SE and Java EE?
Java SE (formerly J2SE) is the basic Java environment. In Java SE, you make all the "standards" programs with Java, using the API described here. You only need a JVM to use Java SE.
Java EE (formerly J2EE) is the enterprise edition of Java. With it, you make websites, Java Beans, and more powerful server applications. Besides the JVM, you need an application server Java EE-compatible, like Glassfish, JBoss, and others.
Java SE stands for Java standard edition and is normally for developing desktop applications, forms the core/base API.
Java EE stands for Java enterprise edition for applications which run on servers, for example web sites.
Java ME stands for Java micro edition for applications which run on resource constrained devices (small scale devices) like cell phones, for example games.
http://www.dreamincode.net/forums/topic/99678-j2se-vs-j2ee-what-are-main-differences/
As far as the language goes it is not as though java changes. Java EE has access to all of the SE libraries. However EE adds a set of libraries for dealing with enterprise applications.
Java EE is more like a "platform" or an general area of development.
In Java SE you write applications that run as standalone java programs or as Applets. In JavaEE you can still do this, but you can also write applications that run inside of a Java EE container. The container can do a great amount of management for you such as scaling an application across threads, providing resource pools, and management features.
Java EE has a web framework based upon Servlets. It has JSP (Java Server Pages) which is a templating language that compiles from JSP to a Java servlet where it can be run by the container.
So Java EE is more or less Java SE + Enterprise platform technologies.
Java EE is far more than just a couple of extra libraries (that is what I thought when I first looked at it) since there are a ton of frameworks and technologies built upon the Java EE specifications.
But it all boils down to just plain old java.
Java SE refers to the standard version of Java and its libraries. Java EE refers to the Enterprise edition of Java which is used to deploy web applications.
Java EE is enterprise edition.
Includes jsp, servlets, beans, and some other stuff for server programming.
Java SE is standard edition. This is plain old Java. Includes GUI stuff.
First, J2SE and J2EE have been renamed. They're now Java SE and Java EE.
Essentially, Java SE is your standard Java designed for end-users. That's what you'd develop to for desktop applications. Java EE is the enterprise edition, designed for server programming, such as SOA and web applications.
Best description i've encounter so far is available on Oracle website.
Java SE's API provides the core functionality of the Java programming language. It defines everything from the basic types and objects of the Java programming language to high-level classes that are used for networking, security, database access, graphical user interface (GUI) development, and XML parsing.
The Java EE platform is built on top of the Java SE platform. The Java EE platform provides an API and runtime environment for developing and running large-scale, multi-tiered, scalable, reliable, and secure network applications.
If you consider developing application using for example Spring Framework you will use both API's and would have to learn key concept of JavaServer Pages and related technologies like for ex.: JSP, JPA, JDBC, Dependency Injection etc.
Java SE contains all the base packages. Some of the base packages are written in Java and some are written in C/C++. The base packages are the fastest because there are no additional layers on top of their core functionality.
Java EE is a set of specifications and the respective implementations are all built using Java SE base packages which happen to already contain everything required for any application. For example, for a web application, here is a Java SE Web Server and a Java SE Database.
Java SE 9/10 is expected to contain better support for native in order to improve the inherent performance issues it has from being an interpreted language. Using the enormous Java EE implementations implies a willingness to sacrifice performance, scalability and a lot of time and money for education and updates, in exchange for project standardization.
JavaSE and JavaEE both are computing platform which allows the developed software to run.
There are three main computing platform released by Sun Microsystems, which was eventually taken over by the Oracle Corporation. The computing platforms are all based on the Java programming language. These computing platforms are:
Java SE, i.e. Java Standard Edition. It is normally used for
developing desktop applications. It forms the core/base API.
Java EE, i.e. Java Enterprise Edition. This was originally known as
Java 2 Platform, Enterprise Edition or J2EE. The name was eventually
changed to Java Platform, Enterprise Edition or Java EE in version 5.
Java EE is mainly used for applications which run on servers, such as
web sites.
Java ME, i.e. Java Micro Edition. It is mainly used for applications
which run on resource constrained devices (small scale devices) like
cell phones, most commonly games.
In Java SE you need software to run the program like if you have developed a desktop application and if you want to share the application with other machines all the machines have to install the software for running the application. But in Java EE there is no software needed to install in all the machines. Java EE has the forward capabilities. This is only one simple example. There are lots of differences.
The biggest difference are the enterprise services (hence the ee) such as an application server supporting EJBs etc.

Categories