Hello Everyone! So if I am working in Java, let's say that I have finished my program and I'm done with it. How can I make a file with my program in it so when I press the file or application, the program runs and displays me the output without having to use NetBeans or Eclipse. Thanks in advance!
Java Program without Netbeans or Eclipse
Solution 1: By using command prompt
1. Install JDK (Java development kit) in C:/Program Files and copy the 'java.exe' file path
2. Set environment variables (Go to 'Control PanelSystem and SecuritySystem' –> Advanced System Settings –>Advanced –> Environment Variables –> Path and append it with the path noted in Step 1)
3. Write the java code in notepad and save it with the same name as that of the class(used in code) with .java extension
4. Go to Command prompt and go to the directory/path where your notepad file is kept by using cd(change directory) command
5. Type 'javac Filename.java', so it will compile the code and create a class file
6. Type 'java Filename' and enter , it will run the code and give the output.