Java Tutorial - How to write, compile and run Java programs all within Notepad++

Опубликовано: 14 Февраль 2025
на канале: Martin O'Connor
13,001
73

How to write, compile and run Java programs all within Notepad++.

This is a short video tutorial to illustrate the steps required to configure the Notepad++ editor on Windows so as to allow you to write, compile and run a Java program all within the Notepad++ editor and consequently, not having to use the command prompt. The major benefits to be obtained is a quicker Java development lifecycle and an accelerated learning process as you progress in learning Java.

In this video I am using Windows 7 but these steps will work equally well for Windows 8, 8.1 and Windows 10. This video tutorial assumes you have already downloaded and installed the Notepad++ editor on your computer (if you have not, please watch this video    • How to download and install the Notep...  ). This video tutorial also assumes you have already downloaded and installed the Java JDK.

For your convenience, I am including below the commands required by the NppExec plugin (explained in the video).

NPP_SAVE
cd $(CURRENT_DIRECTORY)
c:\java\jdk180\bin\javac $(FILE_NAME)
c:\java\jdk180\bin\java $(NAME_PART)

Note: the full path to my Java installation folder is c:\java\jdk180. You may have installed the Oracle Java JDK into a different location, hence your full pathname may be different. I have added one additional command that is not in the video - NPP_SAVE. This command tells the NppExec plugin to save the current Java source file being edited before attempting to compile and run it. Thus, it eliminates the requirement to save the Java source file each time you wish to compile it.

There is a deeper motivation behind this video. Briefly, in 1984 David Kolb published what is considered a ground breaking book called Experiential Learning: experience as the source of learning and development. It facilitates an accelerated learning lifecycle. Feedback that is received sooner and more frequently allows for corrective action to be taken at an earlier stage in the learning process, and hence leads not only to better learning outcomes, but more learning outcomes in less time. Thus, it is win-win situation. This is the pedagogical reasoning underlying my motivation to make this video tutorial – to help you learn more and better in less time. I hope it may be of assistance to you.

WATCH SOME MORE JAVA TUTORIALS

Enhanced For Loop Explained and Illustrated
   • Java Tutorial - Enhanced For Loop Exp...  

For Loops Explained and Common Pitfalls Highlighted
   • Java Tutorial - For Loops Explained a...  

How to use the Shortcut Operators
   • Java Tutorial - How to use Shortcut O...  

How to use the Conditional Operator ( ? : )
   • Java Tutorial - How to use Conditiona...  

Compare Objects - Equality Operator Vs Equals Method
   • Java Tutorial - Compare Objects - Equ...  

Passing by Value (Object References)
   • Java Tutorial - Passing by Value (Obj...  

Command Line Arguments
   • Java Tutorial - Command Line Arguments  

How To Write A Method Part II
   • Java Tutorial - How To Write A Method...  

How To Write A Method Part I
   • Java Tutorial - How To Write A Method...  

Passing by Value (Primitive Data Types)
   • Java Tutorial - Passing by Value (Pri...  

Division and Modulo Operators Explained
   • Java Tutorial - Division and Modulo O...  

Operator Precedence Explained
   • Java Tutorial -  Operator Precedence ...  

What are Data Types, Variables and Constants?
   • Java Tutorial - Introduction to Data ...  

How to use Nested If Statements
   • Java Tutorial - How to use If Stateme...  

How to use simple If Statements
   • Java Tutorial - How to use If Statements  

What are Control Flow Statements
   • Java Tutorial - What are Control Flow...  

How to Write, compile and run your first Java program on Windows
   • Java Tutorial - How to Write, compile...  

How to download and install the Notepad++ editor on Windows
   • How to download and install the Notep...