I was wondering if there was any way to program from the command line prompt. I am running windows 7, and I can compile and run code using the javac and java commands with the JDK, but I was wondering if I could program from the command line as well, instead of using an IDE or even NoteBook. Thanks in advance.
and welcome to JavaRanch
What exactly do you mean by "programming from the command line"? As Java isn't a scripting language and therefore doesn't provide something like a scripting shell you should at least have some kind of editor. Maybe the old command line editor (don't know if it's still included in Windows 7) is enough for you then you can program from the command line. More or less. It may work but it's surely not very convenient without any tool support.
Thanks for the reply.
I know what you mean about tool support. It is a lot easier to write code with an editor. However, I have a buddy who is asking me to research the idea for him. I have always used netbeans to compile and run programs, personally.
I am simply researching the idea of writing code from the command prompt (yes, windows 7 still has it) and saving it in a .java file so that one can compile it with the javac command and run the .class file with the java command.
Andrew Monkhouse wrote:... even the "edit" command (assuming it still exists in Windows 7)) ...
In case you are unaware of that editor, it was introduced around DOS 4.0 (I think - I remember using it prior to Windows 3.1). From the command line, you enter "edit [filename]" (e.g. "edit Hello.java") and it opens the file in a simple editor:
Not a great editor, but it will get the job done. And is way better than millions of "echo" type statements.
And reduce all class names and variable names to a single letter!
Absolutely! Just imagine all those wasted bytes!
Btw. your screenshot reminds of the times when we really used this editor to save a few bytes just by tweaking our AUTOEXEC.BAT or CONFIG.SYS file! Those were the days...
Marco Ehrentreich wrote:Btw. your screenshot reminds of the times when we really used this editor to save a few bytes just by tweaking our AUTOEXEC.BAT or CONFIG.SYS file! Those were the days...
Yep - I remember those days!
And writing batch scripts that would create separate batch scripts based on user inputs that would then be run to perform installations or upgrades of software.