
They are usable by the method under the name "args" which is shorthand for "arguments". In this case it expects to receive an array (denoted by "") of Strings to run, or, in other words, it expects to receive a list of words.
#COMPILING JAVA PROGRAM FOR WINDOWS CODE#
The code inside the parentheses denotes the inputs of the method or what the method expects to receive from whomever using it. The curly braces again describe where this part of the program starts and ends. Next to main we have a left parenthesis some code and a left parenthesis followed by the curly braces. In this case we do not want to produce anything so we state "void" so the computer knows not to be expecting anything at the end of the instruction. The last word described what sort of object the method produces. The specific details of word requires a deeper knowledge to fully understand so it the author will leave it up to the reader to investigate thing more on their own to gain this understanding. The next word is optional and describes when the method can be used.

The first word describes who can use the method, and since this is the main method it must be available for everyone to use so it says "public." These words describe specific attributes of the method. In front of the main method's name are three words. Since there are no instructions within main right now, running the program will cause nothing to happen. This is because when a java program is run it the first thing a computer looks for is a method named "main" and follows out all the instructions within that method. When a class contains a "main" method it allows a program to be executed. The "main" method of a class is quite literally the main instruction of a program. What we just wrote is the "main" instruction, or method, of our program. Your program should now look like the picture. Inside your file type "class MyFirstProgram ".ģ. That C file then gets compiled with the rest of my JVM (which contains everything a standard JVM has, GC, memory management, bytecode verifier, classloader, etc.), which produces some executable/image that can be flashed to the MCU. Basically, I write my app in Java, compile it to bytecode, run it through the bytecode_file_generator, turning it into a C file named bytecode_input.c. Unless I'm missing anything (again, understanding that the steps above are by no means trivial and each of them are probably several man-years in the making), I believe that's all one would need.

#COMPILING JAVA PROGRAM FOR WINDOWS WINDOWS#
I am interested in understanding the process and tooling involved with writing a Java app on, say, a Linux or Windows machine, and then cross-compiling that app into an image that can be directly flashed to an MCU, such as the ARM SAM3X8E. In reality, its more about confirming my knowledge of low-level computer architecture than anything else, and is not necessarily something that I'm going to endeavour to actually do. Please note: although I am using ARM SAM3X8E in this example, I'm just using that as a concrete example, and the answer to this question could easily be given using any other MCU such as AVR, etc.
