


(To do this, click on Start, then click on AllPograms, then Accesories, then ComandPrompt.
#How to run a bluej program in cmd how to
How to use javadoc from the command window: To use javadoc on a project folder Assign1, do the following: Open a command-prompt window. However, blueJ will let you run any static method in a class (so you can test your functions) where as the command line java command will (only) look for a special main method to run. Compiling and running Java programs with BlueJ Right click on the program file in BlueJs main window, and then Left click on the void main(Stringargs) tab. For this reason, you must use a command-prompt window (an MS-DOS window'') for constructing a jar file. To run it, we need to run java with the name of the class as the argument (Not the file!) Wrong java MyFirstClass.class Your program is valid and will compile to the same thing whether you compile from BlueJ or from the command line. BlueJ automates several of the tasks for the programmer. This will create a file called MyFirstClass.class that holds the compiled java code. and running programs easier and faster than using the command line. Left click on the void main (String args) tab: A window will pop up: Left click on OK to run the program.

If we take the code from the previous lesson and put it in a file called MyFirstClass.java, in order to compile it we need to run: javac MyFirstClass.java Execute a Java program in BlueJ: Right click on the program file in BlueJ's main window, and then.
#How to run a bluej program in cmd install
In order for those to be available you must download and install JDK (Java Development Kit). You need to have a console and you need to have the following commands available in order to compile and run Java. It shouldn't really matter if you use Linux, Mac or Windows. This section is used for you to use Java at home and understand the basics of how things are done.Īfter creating a simple application that prints something to the screen, you need to compile your code and run it.
