Results 1 to 3 of 3
- 01-02-2015, 05:23 AM #1
Member
- Join Date
- Jan 2015
- Posts
- 1
- Rep Power
- 0
Can't execute the Java code from the command line in Notepad++
I have the program written correctly, but it won't execute.
public class Welcome {
public static void main(String[] args){
//Display message Welcome to Java! on the console
System.out.println("Welcome to Java");
}
}
I compiled the code as written below with "javac Welcome", and use the "Class" name "Welcome"
The file path is: C:\Java Programs
Javac Welcome.java
Java Welcome
Below is the result of the above commands
javac Welcome
Create Process() failed with error code 2:
The system cannot find the file specified.
java Welcome
Process started >>>
Error: Could not find or load main class Welcome
<<< Process finished. (Exit code 1)
Somebody Please Help Me! I am coding in notepad++
- 01-02-2015, 01:08 PM #2
Senior Member
- Join Date
- Jan 2011
- Location
- Belgrade, Serbia
- Posts
- 311
- Rep Power
- 10
Re: Can't execute the Java code from the command line in Notepad++
did you programmed java in notepad++ before?
- 01-02-2015, 02:41 PM #3
Re: Can't execute the Java code from the command line in Notepad++
The first use shown of the javac command works but the second use does not. Notice the difference between the args to the command: the first has the extension: .java, the second does not hava .java
If you don't understand my response, don't ignore it, ask a question.
Similar Threads
-
Is There a way to Only Execute A line Of Code once?
By AyooNisto in forum New To JavaReplies: 11Last Post: 12-16-2012, 06:51 PM -
Execute Cygwin command from Java app
By ZebraIzToronto in forum Advanced JavaReplies: 1Last Post: 01-21-2011, 06:51 AM -
Compiling java code from the command line
By alman9898 in forum New To JavaReplies: 5Last Post: 10-13-2010, 04:35 AM -
Formatting java command line output - Multi line string
By dricco in forum New To JavaReplies: 2Last Post: 07-02-2010, 03:20 PM -
Unable to execute command line command in java
By LordSM in forum New To JavaReplies: 1Last Post: 08-08-2007, 01:23 AM
Bookmarks