JavaCore java
JDK setup
IDE vs Editor
-
IDE (Integrated Development Environment):
- Examples: IntelliJ IDEA, Eclipse, VS Code
- Provides advanced features → debugging, autocomplete, project management, plugins.
-
Editor (Lightweight Tools):
- Examples: Notepad, VS Code, Notepad++, Sublime
- Just text editing; no built-in compiler/debugger (need external setup).
JDK (Java Development Kit)
- Compiler required to compile Java code → provided by JDK.
- Install JDK (open-source builds like OpenJDK or official Oracle JDK).
- Always install the latest version to get new features.
- Java is backward compatible, so old code runs on newer JDKs.
LTS (Long Term Support)
- Stable versions supported for many years.
- Recommended LTS versions: 17, 21 (commonly used in industry).
Installation & Setup
Steps to Install JDK:
-
Download JDK (Oracle or OpenJDK).
-
Install → note the installation directory (e.g.,
C:\Program Files\Java\jdk-21
). -
Set Environment Variables →
- Add JDK bin path (e.g.,
C:\Program Files\Java\jdk-21\bin
).
- Add JDK bin path (e.g.,
Environment Variables
- User Variable → applies only to the current user.
- System Variable → applies to all users in the system.
To check version installed:
java -version
javac -version
Steps to Install & Setup VS Code
-
Download and install VS Code.
-
Install Java Extensions Pack (from Extensions Marketplace).
-
Important extensions:
- Extension Pack for Java
- Debugger for Java
- Java Test Runner
- Maven for Java
-
-
Open a new Java file → VS Code will automatically detect JDK.
✅ Example check after setup:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, Java Setup Successful!");
}
}