What is the difference between Java and J2EE?

Core Java usually refers to Java SE which consists of the Java Language, the JVM and JDK (which itself contains the compiler some tools and a pretty large library).

Enterprise Java refers to Java applications written for enterprises; the leading technology here is Java EE which consists of a set of APIs (EJB, JMS, JPA, JTA, JSF etc.) and the application servers (Glassfish, Tomcat, JBoss/WildFly etc.) which implement these APIs (or a part of them).

Java SE is used for general purpose programming and almost anything written in Java is based on the Core Java.

J2EE is the API built on top of the SE API to provide the tools necessary to do large scale projects more easily.

Java EE stands for Java enterprise edition for applications which run on servers, for example web sites.

Java is OOP language. Using java you can write standalone command line programs. When combined with tooling libs like Swing you can build GUI based desktop application.

J2EE is a set of specifications which targets the enterprise technologies like JMS, WS, Servlets, JSP, EJB’s etc. Most of these specification are implemented using Java. Using J2EE technology stack you can write complex business application.