8,367
edits
Changes
→Ubuntu Focal system
<ol style="list-style-type: lower-alpha;">
<li><p>The version of a.gcc is as follows</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
<p>gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0</p>
<p>Copyright (C) 2019 Free Software Foundation, Inc.</p>
<p>This is free software; see the source for copying conditions. There is NO</p>
<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>|}</li>
<li><p>Write the '''hello_world.c''' program in C language</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include <stdio.h></p>
<p>int main(void)</p>
<p>{</p>
:<p>printf("Hello World!\n");</p> :<p>return 0;</p><p>}</p>|}</li>
<li><p>Then compile and run '''hello_world.c'''</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''./hello_world'''</p>
<p>Hello World!</p>|}</li></ol>
</li>
<li><p>Ubuntu Focal has Python3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python3 is as follows</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''python3'''</p>
<p>Python 3.8.10 (default, Nov 14 2022, 12:59:47)</p>
<p>Type "help", "copyright", "credits" or "license" for more information.</p>
<p>>>></p>
|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></big>|}</li>
<li><p>Write the '''hello_world.py''' program in Python language</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<p>print('Hello World!')</p>|}</li>
<li><p>The result of running '''hello_world.py''' is as follows</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p>
<p>Hello World!</p>|}</li></ol>
</li>
<li><p>Ubuntu Focal does not have Java compilation tools and running environment installed by default.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>You can use the following command to install openjdk-17</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-17-jdk'''</p>|}</li>
<li><p>After installation, you can check the Java version.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''java --version'''</p>
<p>openjdk 17.0.2 2022-01-18</p>
<p>OpenJDK Runtime Environment (build 17.0.2+8-Ubuntu-120.04)</p>
<p>OpenJDK 64-Bit Server VM (build 17.0.2+8-Ubuntu-120.04, mixed mode, sharing)</p>|}</li>
<li><p>Write the Java version of '''hello_world.java'''</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''vim hello_world.java'''</p>
<p>public class hello_world</p>
<p>{</p>
:<p>public static void main(String[] args)</p>:<p>{</p>::<p>System.out.println("Hello World!");</p>:<p>}</p>
<p>}</p>
<li><p>Then compile and run '''hello_world.java'''</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''javac hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''java hello_world'''</p>
<p>Hello World!</p>|}</li></ol>
</li></ol>
<span id="ubuntu-jammy-system"></span>
=== Ubuntu Jammy system ===