<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ro">
	<id>http://wiki.dcae.pub.ro/index.php?action=history&amp;feed=atom&amp;title=Writing_and_Executing_a_Java_Program</id>
	<title>Writing and Executing a Java Program - Revizia istoricului</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.dcae.pub.ro/index.php?action=history&amp;feed=atom&amp;title=Writing_and_Executing_a_Java_Program"/>
	<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=Writing_and_Executing_a_Java_Program&amp;action=history"/>
	<updated>2026-05-27T08:04:04Z</updated>
	<subtitle>Istoricul versiunilor pentru această pagină din wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=Writing_and_Executing_a_Java_Program&amp;diff=1521&amp;oldid=prev</id>
		<title>Rhobincu: /* Program Execution Inside the Virtual Machine */</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=Writing_and_Executing_a_Java_Program&amp;diff=1521&amp;oldid=prev"/>
		<updated>2013-10-22T09:44:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Program Execution Inside the Virtual Machine&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 22 octombrie 2013 09:44&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l156&quot; &gt;Linia 156:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 156:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Rule:&amp;lt;/font&amp;gt; The JVM will &amp;#039;&amp;#039;&amp;#039;always&amp;#039;&amp;#039;&amp;#039; take as an argument the &amp;#039;&amp;#039;&amp;#039;name of the class&amp;#039;&amp;#039;&amp;#039; (without the extension) which needs to be executed.div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Rule:&amp;lt;/font&amp;gt; The JVM will &amp;#039;&amp;#039;&amp;#039;always&amp;#039;&amp;#039;&amp;#039; take as an argument the &amp;#039;&amp;#039;&amp;#039;name of the class&amp;#039;&amp;#039;&amp;#039; (without the extension) which needs to be executed.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/&lt;/ins&gt;div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Rule:&amp;lt;/font&amp;gt; A Java class can only be ran in the virtual machine if it contains, as a member, the &amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039; method, exactly how it is defined in the specification: &amp;#039;&amp;#039;public static void main(String[])&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Rule:&amp;lt;/font&amp;gt; A Java class can only be ran in the virtual machine if it contains, as a member, the &amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039; method, exactly how it is defined in the specification: &amp;#039;&amp;#039;public static void main(String[])&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=Writing_and_Executing_a_Java_Program&amp;diff=1520&amp;oldid=prev</id>
		<title>Rhobincu la 22 octombrie 2013 09:44</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=Writing_and_Executing_a_Java_Program&amp;diff=1520&amp;oldid=prev"/>
		<updated>2013-10-22T09:44:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 22 octombrie 2013 09:44&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l145&quot; &gt;Linia 145:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 145:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If the compiler displayed error messages, then read them carefully and fix the Java source code problems.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If the compiler displayed error messages, then read them carefully and fix the Java source code problems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Execuția programului în mașina virtuală &lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Program Execution Inside the Virtual Machine &lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;În locul unde s-a compilat codul sursă&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;folosind executabilul &lt;/del&gt;&amp;#039;&amp;#039;java&amp;#039;&amp;#039; (&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;mașina virtuală&lt;/del&gt;), &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;se execută programul&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;In the directory where the source code has been compiled&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;using the &lt;/ins&gt;&amp;#039;&amp;#039;java&amp;#039;&amp;#039; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;executable &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the virtual machine&lt;/ins&gt;), &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the program is executed&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l156&quot; &gt;Linia 156:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 156:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Regulă&lt;/del&gt;:&amp;lt;/font&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Întotdeauna, mașina virtuală Java va lua ca &lt;/del&gt;argument &amp;#039;&amp;#039;&amp;#039;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;numele clasei&lt;/del&gt;&amp;#039;&amp;#039;&amp;#039; (&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;fără extensie&lt;/del&gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;care trebuie executat&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/&lt;/del&gt;div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Rule&lt;/ins&gt;:&amp;lt;/font&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The JVM will &amp;#039;&amp;#039;&amp;#039;always&amp;#039;&amp;#039;&amp;#039; take as an &lt;/ins&gt;argument &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/ins&gt;&amp;#039;&amp;#039;&amp;#039;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;name of the class&lt;/ins&gt;&amp;#039;&amp;#039;&amp;#039; (&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;without the extension&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;which needs to be executed&lt;/ins&gt;.div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Regulă&lt;/del&gt;:&amp;lt;/font&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;O clasă &lt;/del&gt;Java &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;nu poate fi rulată în mașina virtuală decât dacă conține metoda &lt;/del&gt;main, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;exact cum este defintă în specificație&lt;/del&gt;: &amp;#039;&amp;#039;public static void main(String[])&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Rule&lt;/ins&gt;:&amp;lt;/font&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;A &lt;/ins&gt;Java &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;class can only be ran in the virtual machine if it contains, as a member, the &amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;main&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&amp;#039; method&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;exactly how it is defined in the specification&lt;/ins&gt;: &amp;#039;&amp;#039;public static void main(String[])&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=Writing_and_Executing_a_Java_Program&amp;diff=1519&amp;oldid=prev</id>
		<title>Rhobincu: /* Compiling the Source */</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=Writing_and_Executing_a_Java_Program&amp;diff=1519&amp;oldid=prev"/>
		<updated>2013-10-22T09:15:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Compiling the Source&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 22 octombrie 2013 09:15&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l127&quot; &gt;Linia 127:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 127:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Compiling the Source ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Compiling the Source ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Open a console&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;navigate to the directory where the source file has been saved&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Then&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;use the &lt;/ins&gt;&amp;#039;&amp;#039;javac&amp;#039;&amp;#039; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;executable &lt;/ins&gt;(Java Compiler) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to compile the code&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;În consolă&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;se navighează folosind comenzile prezentate mai sus până în directorul în care a fost salvat fișierul sursă&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Apoi&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;folosind executabilul &lt;/del&gt;&amp;#039;&amp;#039;javac&amp;#039;&amp;#039; (Java Compiler)&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, se compilează&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;student@olympus07:~/work/poo$ javac MainClass.java&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;student@olympus07:~/work/poo$ javac MainClass.java&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l138&quot; &gt;Linia 138:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 137:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Regulă&lt;/del&gt;:&amp;lt;/font&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Întotdeauna, compilatorul &lt;/del&gt;Java &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;va lua ca &lt;/del&gt;argument &amp;#039;&amp;#039;&amp;#039;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;numele fișierului&lt;/del&gt;&amp;#039;&amp;#039;&amp;#039; (&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cu tot cu extensie&lt;/del&gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;care trebuie compilat&lt;/del&gt;.&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Rule&lt;/ins&gt;:&amp;lt;/font&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The &lt;/ins&gt;Java &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;compiler will &amp;#039;&amp;#039;&amp;#039;always&amp;#039;&amp;#039;&amp;#039; take as &lt;/ins&gt;argument &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/ins&gt;&amp;#039;&amp;#039;&amp;#039;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;file name&lt;/ins&gt;&amp;#039;&amp;#039;&amp;#039; (&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;extension included&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;which needs to be compiled&lt;/ins&gt;. &amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Dacă execuția compilatorului nu a afișat nici o eroare&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;atunci compilarea s-a încheiat cu succes și a fost generat fișierul executabil pentru mașina virtuală, cu extensia &lt;/del&gt;.class.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;If the compilation did not display any message&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;then it has completed successfully and the executable file for the virtual machine has been created (&lt;/ins&gt;.class &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;extension)&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Dacă compilatorul nu a putut fi găsit&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;atunci verificați variabila de sistem &lt;/del&gt;PATH&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, conform instrucțiunilor de instalare pentru &lt;/del&gt;JDK.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;If the compiler could not be found&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;then check the &lt;/ins&gt;PATH &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;environment variable as per the &lt;/ins&gt;JDK &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;installation instructions&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Dacă compilatorul a afișat erori&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;citiți-le cu atenție și reparați problemele din codul sursă &lt;/del&gt;Java.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;If the compiler displayed error messages&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;then read them carefully and fix the &lt;/ins&gt;Java &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;source code problems&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Execuția programului în mașina virtuală ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Execuția programului în mașina virtuală ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=Writing_and_Executing_a_Java_Program&amp;diff=1518&amp;oldid=prev</id>
		<title>Rhobincu: Pagină nouă: In order to develop a Java program, there are two operations that need to be performed: the compilation of a source code and the execution of the program inside the virtual machine. T...</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=Writing_and_Executing_a_Java_Program&amp;diff=1518&amp;oldid=prev"/>
		<updated>2013-10-22T08:59:30Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: In order to develop a Java program, there are two operations that need to be performed: the compilation of a source code and the execution of the program inside the virtual machine. T...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pagină nouă&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In order to develop a Java program, there are two operations that need to be performed: the compilation of a source code and the execution of the program inside the virtual machine. The source code can be written in any text editor. For Microsoft Windows, a good suggestion is [http://notepad-plus-plus.org/ Notepad++]. For Linux, depending on the X interface, you can use either &amp;#039;&amp;#039;Kate&amp;#039;&amp;#039; for KDE or &amp;#039;&amp;#039;gedit&amp;#039;&amp;#039; for Gnome/ Unity/ Cinnamon. During this lab, we will be using &amp;#039;&amp;#039;Kate&amp;#039;&amp;#039;. You can run it by clicking Applications -&amp;gt; Accessories -&amp;gt; Kate.&lt;br /&gt;
&lt;br /&gt;
== Command Line Tutorial ==&lt;br /&gt;
&lt;br /&gt;
Before compiling and executing a Java program, we will need a short introduction for using the console in both MS Windows and Linux.&lt;br /&gt;
&lt;br /&gt;
=== MS Windows cmd ===&lt;br /&gt;
&lt;br /&gt;
In Windows, the console is stated by pressing &amp;quot;winkey + r&amp;quot;, then typing &amp;#039;&amp;#039;cmd&amp;#039;&amp;#039;. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[Fișier:cmd.png|Consola sistemului de operare Windows]]&lt;br /&gt;
&lt;br /&gt;
A few useful commands:&lt;br /&gt;
&lt;br /&gt;
* if the files are on another partition, like D, or E, the command that changes the path to the D partition, for example, is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
c:\Users\Echo&amp;gt; d:&lt;br /&gt;
d:\&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* for changing the current directory, the &amp;#039;&amp;#039;cd&amp;#039;&amp;#039; command is used (change directory):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
c:\Users\Echo&amp;gt; cd Documents&lt;br /&gt;
c:\Users\Echo\Documents&amp;gt; cd work&lt;br /&gt;
c:\Users\Echo\Documents\work&amp;gt; cd ..&lt;br /&gt;
c:\Users\Echo\Documents&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* for displaying the content of the current directory, you can use the &amp;#039;&amp;#039;dir&amp;#039;&amp;#039; command:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
C:\Users\Echo\Documents\work\poo&amp;gt; dir&lt;br /&gt;
 Volume in drive C has no label.&lt;br /&gt;
 Volume Serial Number is 9C96-4AC6&lt;br /&gt;
&lt;br /&gt;
 Directory of C:\Users\Echo\Documents\work\poo&lt;br /&gt;
&lt;br /&gt;
18-Jul-12  10:42    &amp;lt;DIR&amp;gt;          .&lt;br /&gt;
18-Jul-12  10:42    &amp;lt;DIR&amp;gt;          ..&lt;br /&gt;
18-Jul-12  10:43               117 MainClass.java&lt;br /&gt;
               1 File(s)            117 bytes&lt;br /&gt;
               2 Dir(s)  22,145,564,672 bytes free&lt;br /&gt;
&lt;br /&gt;
C:\Users\Echo\Documents\work\poo&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* for creating a new directory, use &amp;#039;&amp;#039;md&amp;#039;&amp;#039; (make directory):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
C:\Users\Echo\Documents\work\poo&amp;gt; md test&lt;br /&gt;
&lt;br /&gt;
C:\Users\Echo\Documents\work\poo&amp;gt; dir&lt;br /&gt;
 Volume in drive C has no label.&lt;br /&gt;
 Volume Serial Number is 9C96-4AC6&lt;br /&gt;
&lt;br /&gt;
 Directory of C:\Users\Echo\Documents\work\poo&lt;br /&gt;
&lt;br /&gt;
18-Jul-12  10:45    &amp;lt;DIR&amp;gt;          .&lt;br /&gt;
18-Jul-12  10:45    &amp;lt;DIR&amp;gt;          ..&lt;br /&gt;
18-Jul-12  10:43               117 MainClass.java&lt;br /&gt;
18-Jul-12  10:45    &amp;lt;DIR&amp;gt;          test&lt;br /&gt;
               1 File(s)            117 bytes&lt;br /&gt;
               3 Dir(s)  22,145,433,600 bytes free&lt;br /&gt;
&lt;br /&gt;
C:\Users\Echo\Documents\work\poo&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Linux Bash ===&lt;br /&gt;
&lt;br /&gt;
In Linux, depending on the distribution and interface, you can start the terminal by either pressing &amp;quot;Alt + Ctrl + T&amp;quot;, or by selecting &amp;#039;&amp;#039;&amp;#039;Terminal&amp;#039;&amp;#039;&amp;#039; from Applications -&amp;gt; Accessories: &lt;br /&gt;
&lt;br /&gt;
[[Fișier:linux_console.png|Consola din Linux]]&lt;br /&gt;
&lt;br /&gt;
A few useful commands:&lt;br /&gt;
* to display the current directory, use &amp;#039;&amp;#039;pwd&amp;#039;&amp;#039; (print working directory):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
student@olympus07:~$ pwd &lt;br /&gt;
/home/student&lt;br /&gt;
student@olympus07:~$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* for changing the current directory, the &amp;#039;&amp;#039;cd&amp;#039;&amp;#039; command is used (change directory):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
student@olympus07:~$ cd work&lt;br /&gt;
student@olympus07:~/work$ pwd &lt;br /&gt;
/home/student/work&lt;br /&gt;
student@olympus07:~/work$ cd ..&lt;br /&gt;
student@olympus07:~$ pwd &lt;br /&gt;
/home/student&lt;br /&gt;
student@olympus07:~$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* for displaying the content of the current directory, you can use the &amp;#039;&amp;#039;ls -l&amp;#039;&amp;#039; command (list structure, long listing format):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
student@olympus07:~/work/poo$ ls -l&lt;br /&gt;
total 4&lt;br /&gt;
-rw-rw-r-- 1 student student 110 Jul 18 11:08 MainClass.java&lt;br /&gt;
student@olympus07:~/work/poo$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* to create a new directory, use &amp;#039;&amp;#039;mkdir&amp;#039;&amp;#039; (make directory):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
student@olympus07:~/work/poo$ mkdir test&lt;br /&gt;
student@olympus07:~/work/poo$ ls -l&lt;br /&gt;
total 8&lt;br /&gt;
-rw-rw-r-- 1 student student  110 Jul 18 11:08 MainClass.java&lt;br /&gt;
drwxrwxr-x 2 student student 4096 Jul 18 11:10 test&lt;br /&gt;
student@olympus07:~/work/poo$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Writing, Compiling and Executing a Java Program == &lt;br /&gt;
&lt;br /&gt;
=== Editing the Source Code ===&lt;br /&gt;
&lt;br /&gt;
The first step in writing a Java program, is editing the source code. For this, use your favorite editor and save the file with a .java extension.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Rule:&amp;lt;/font&amp;gt; A Java source code will &amp;#039;&amp;#039;&amp;#039;always&amp;#039;&amp;#039;&amp;#039; have a .java extension.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Rule:&amp;lt;/font&amp;gt; The name of a class contained in a source file must &amp;#039;&amp;#039;&amp;#039;always&amp;#039;&amp;#039;&amp;#039; have the same identical name with the file. I.e.: The class MainClass &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; be saved in a file named MainClass.java. &amp;#039;&amp;#039;&amp;#039;Attention&amp;#039;&amp;#039;&amp;#039;: Java is case-sensitive!!!&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, we will write the following class:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class MainClass{&lt;br /&gt;
&lt;br /&gt;
public static void main(String[] _args){&lt;br /&gt;
    System.out.println(&amp;quot;Hello world!&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This class must be saved in a file called MainClass.java.&lt;br /&gt;
&lt;br /&gt;
=== Compiling the Source ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
În consolă, se navighează folosind comenzile prezentate mai sus până în directorul în care a fost salvat fișierul sursă. Apoi, folosind executabilul &amp;#039;&amp;#039;javac&amp;#039;&amp;#039; (Java Compiler), se compilează:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
student@olympus07:~/work/poo$ javac MainClass.java&lt;br /&gt;
student@olympus07:~/work/poo$ ls -l&lt;br /&gt;
total 8&lt;br /&gt;
-rw-rw-r-- 1 student student 424 Jul 18 11:22 MainClass.class&lt;br /&gt;
-rw-rw-r-- 1 student student 110 Jul 18 11:08 MainClass.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Regulă:&amp;lt;/font&amp;gt; Întotdeauna, compilatorul Java va lua ca argument &amp;#039;&amp;#039;&amp;#039;numele fișierului&amp;#039;&amp;#039;&amp;#039; (cu tot cu extensie) care trebuie compilat.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dacă execuția compilatorului nu a afișat nici o eroare, atunci compilarea s-a încheiat cu succes și a fost generat fișierul executabil pentru mașina virtuală, cu extensia .class.&lt;br /&gt;
&lt;br /&gt;
Dacă compilatorul nu a putut fi găsit, atunci verificați variabila de sistem PATH, conform instrucțiunilor de instalare pentru JDK.&lt;br /&gt;
&lt;br /&gt;
Dacă compilatorul a afișat erori, citiți-le cu atenție și reparați problemele din codul sursă Java.&lt;br /&gt;
&lt;br /&gt;
=== Execuția programului în mașina virtuală ===&lt;br /&gt;
&lt;br /&gt;
În locul unde s-a compilat codul sursă, folosind executabilul &amp;#039;&amp;#039;java&amp;#039;&amp;#039; (mașina virtuală), se execută programul:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
student@olympus07:~/work/poo$ java MainClass&lt;br /&gt;
Hello world!&lt;br /&gt;
student@olympus07:~/work/poo$ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Regulă:&amp;lt;/font&amp;gt; Întotdeauna, mașina virtuală Java va lua ca argument &amp;#039;&amp;#039;&amp;#039;numele clasei&amp;#039;&amp;#039;&amp;#039; (fără extensie) care trebuie executat.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;regula&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Regulă:&amp;lt;/font&amp;gt; O clasă Java nu poate fi rulată în mașina virtuală decât dacă conține metoda main, exact cum este defintă în specificație: &amp;#039;&amp;#039;public static void main(String[])&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
</feed>