From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KJy3Lgyfj1+4MQAA0tVLHw (envelope-from ) for ; Wed, 21 Oct 2020 02:38:04 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id AHCSKgyfj1+GQgAAB5/wlQ (envelope-from ) for ; Wed, 21 Oct 2020 02:38:04 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2C060940414 for ; Wed, 21 Oct 2020 02:38:04 +0000 (UTC) Received: from localhost ([::1]:35610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kV40o-00045F-U4 for larch@yhetil.org; Tue, 20 Oct 2020 22:38:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kV40Q-00043t-PV for emacs-orgmode@gnu.org; Tue, 20 Oct 2020 22:37:38 -0400 Received: from mail-ed1-f48.google.com ([209.85.208.48]:45763) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kV40M-0006pA-Pm for emacs-orgmode@gnu.org; Tue, 20 Oct 2020 22:37:38 -0400 Received: by mail-ed1-f48.google.com with SMTP id dg9so802280edb.12 for ; Tue, 20 Oct 2020 19:37:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O/yhJdgpYFtjNiiKiz9hG5KJZLy2Sd3UP6CN4Bnd0xQ=; b=a0PX39G6NXtmJ/aSMOrVVMyH/SJmTCWImIyGi+udlkDcGJuaP53GKe2wupJ8BA69Xn BKiw4pXlOC+EoOQF/1eGPSqQdimcV4mhUuAmBZ787ikM5wpLMGr/irRV9sBIO7FsTwdu ZSzgZndQPVPi+SuPYIRXl4ONaWVcx5Gjjhi4Wg5q9DSt3D2URT8XHyysXjkXPLsYvPTZ Gc1kiUBT4NzHwQCHt/XgbPkiEJcvgo/qydLQ6yRzRZGVTkhUWUdb52E9WFOYUzRrPow0 AD/kWCrAgGPYJyzI/MxEwOEemi7tu+oHMN8OIxS7sfeH0Fet2jHsrzzGQLCGhgK21exo JdxA== X-Gm-Message-State: AOAM533Wg11ZIQC0oXzx0G+0OdyhA/QjHud97wse5aEm9nVp8RiZPQKT /Z+l4ypBjMW964BD+JEMqCuJ2z/lovu1tqvMobg= X-Google-Smtp-Source: ABdhPJwy9LQUClq1kiIy+1Xp2y/pXO6Da9D3RFOLFw/I+RBvbQre0PlsMs0l3UufZ5DnCoMR09mZitpqR877iJW9DKI= X-Received: by 2002:a05:6402:1503:: with SMTP id f3mr886305edw.141.1603247852694; Tue, 20 Oct 2020 19:37:32 -0700 (PDT) MIME-Version: 1.0 References: <87h7qohfm8.fsf@gmail.com> In-Reply-To: <87h7qohfm8.fsf@gmail.com> From: ian martins Date: Tue, 20 Oct 2020 22:37:21 -0400 Message-ID: Subject: Re: [PATCH] ob-java To: John Herrlin Content-Type: multipart/alternative; boundary="000000000000bf332705b2253a7e" Received-SPF: pass client-ip=209.85.208.48; envelope-from=ianxm1@gmail.com; helo=mail-ed1-f48.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/20 22:37:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org-Mode mailing list Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=jhu.edu (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.59 X-TUID: EZqP7c8RNs2r --000000000000bf332705b2253a7e Content-Type: text/plain; charset="UTF-8" Thanks for testing, and thanks for pointing that out. I will fix it so that `public` is optional. btw, in your example you didn't have to specify `:classname` since you defined the class name in the source block. btw2, did you notice that you can C-c C-c on source blocks that don't have main methods and it'll compile without error? On Tue, Oct 20, 2020 at 3:17 PM John Herrlin wrote: > > Hey, > > Did some debugging and found out that my class didn't contained =public= > and the patch requires it to be. > > This works fine: > > #+HEADER: :classname Main > #+HEADER: :dir src > #+HEADER: :cmdline -classpath ./rxjava-1.3.8.jar:. > #+HEADER: :cmpflag -classpath ./rxjava-1.3.8.jar > #+BEGIN_SRC java :results output code > import rx.Observable; > public class Main { > public static void main(String[] args) { > Observable.range(5, 5) > .subscribe(System.out::println); > } > } > #+END_SRC > > > > > ian martins writes: > > > I noticed that the tests didn't run with "make test." This updates the > > patch so that they can. I didn't add java to the list of default > languages > > because the java tests are slow. > > > > On Mon, Oct 5, 2020 at 9:23 AM ian martins wrote: > > > >> I wrote those examples in an org file so I could test as I wrote them, > and > >> then exported it to make it more readable, but the export resulted in > >> source block headers being lost. Here is the same without export: > >> ---- > >> * Changes > >> > >> - support for functional mode (~:results value~) > >> - accept variables > >> - don't require package, class, and main definitions > >> - write source and result tempfiles to ~org-babel-temporary-directory~, > >> but respects the ~:dir~ header > >> - work with tramp > >> > >> * Examples > >> ** Example 1 > >> This outputs "hello." If class and main definitions aren't given the > >> code block will be wrapped in generic ones. > >> > >> #+begin_src java :results output silent > >> System.out.print("hello"); > >> #+end_src > >> > >> This is exactly equivalent: > >> > >> #+begin_src java :results output silent > >> public class Main { > >> public static void main(String[] args) { > >> System.out.print("hello"); > >> } > >> } > >> #+end_src > >> > >> ** Example 2 > >> This also outputs "hello." > >> > >> #+begin_src java :results value silent > >> return "hello"; > >> #+end_src > >> > >> ** Example 3 > >> This generates the class "Example" in the package "org.orgmode" in the > >> current directory. > >> > >> #+begin_src java :results output silent :classname org.orgmode.Example > >> :dir . > >> System.out.print("hello, org-mode"); > >> #+end_src > >> > >> ** Example 4 > >> The "Hey" class defines a static method but no main. C-c C-c on the > >> "Hey" source block will write "./org/orgmode/Hey.java" and compile it. > >> > >> The "Main" class calls the "Hey" class. C-c C-c on the "Main" source > >> block will write "./org/orgmode/Main.java" and compile and run it. > >> > >> #+begin_src java :results output silent :dir . > >> package org.orgmode; > >> > >> public class Hey { > >> public static String say() { > >> return "hey"; > >> } > >> } > >> #+end_src > >> > >> #+begin_src java :results output silent :dir . > >> package org.orgmode; > >> > >> public class Main { > >> public static void main(String[] args) { > >> System.out.print(Hey.say()); > >> } > >> } > >> #+end_src > >> > >> Instead of C-c C-c, we could have added tangle headers and written the > >> source files out by tangling. > >> > >> ** Example 5 > >> This prints the variable from the header > >> > >> #+begin_src java :var msg="hello, org-mode" :results output silent > >> System.out.print(msg); > >> #+end_src > >> > >> ** Example 6 > >> This prints "hello, org-mode." The table is provided to the method as a > >> list of lists. > >> > >> #+name: table > >> | message | hello, org-mode | > >> > >> #+begin_src java :var tbl=table :results output silent > >> System.out.print(tbl.get(0).get(1)); > >> #+end_src > >> > >> ** Example 7 > >> This example returns a list. > >> > >> Note that you're allowed to specify imports without defining the class > >> or main methods. > >> > >> #+begin_src java :results value :exports both > >> import java.util.Arrays; > >> > >> return Arrays.asList("message", "hello, org-mode"); > >> #+end_src > >> > >> #+RESULTS: > >> | message | hello, org-mode | > >> > >> On Mon, Oct 5, 2020 at 8:35 AM ian martins wrote: > >> > >>> 1 Changes > >>> ========= > >>> > >>> - support for functional mode (`:results value') > >>> - accept variables > >>> - don't require package, class, and main definitions > >>> - write source and result tempfiles to > >>> `org-babel-temporary-directory', but respects the `:dir' header > >>> - work with tramp > >>> > >>> > >>> 2 Examples > >>> ========== > >>> Some examples follow. See the tests for more examples. I'll write > >>> proper docs after review. > >>> > >>> 2.1 Example 1 > >>> ~~~~~~~~~~~~~ > >>> > >>> This outputs "hello." If class and main definitions aren't given the > >>> code block will be wrapped in generic ones. > >>> > >>> ,---- > >>> | System.out.print("hello"); > >>> `---- > >>> > >>> This is exactly equivalent: > >>> > >>> ,---- > >>> | public class Main { > >>> | public static void main(String[] args) { > >>> | System.out.print("hello"); > >>> | } > >>> | } > >>> `---- > >>> > >>> > >>> 2.2 Example 2 > >>> ~~~~~~~~~~~~~ > >>> > >>> This also outputs "hello." > >>> > >>> ,---- > >>> | return "hello"; > >>> `---- > >>> > >>> > >>> 2.3 Example 3 > >>> ~~~~~~~~~~~~~ > >>> > >>> This generates the class "Example" in the package "org.orgmode" in > the > >>> current directory. > >>> > >>> ,---- > >>> | System.out.print("hello, org-mode"); > >>> `---- > >>> > >>> > >>> 2.4 Example 4 > >>> ~~~~~~~~~~~~~ > >>> > >>> The "Hey" class defines a static method but no main. C-c C-c on the > >>> "Hey" source block will write "./org/orgmode/Hey.java" and compile > it. > >>> > >>> The "Main" class calls the "Hey" class. C-c C-c on the "Main" source > >>> block will write "./org/orgmode/Main.java" and compile and run it. > >>> > >>> ,---- > >>> | package org.orgmode; > >>> | > >>> | public class Hey { > >>> | public static String say() { > >>> | return "hey"; > >>> | } > >>> | } > >>> `---- > >>> > >>> ,---- > >>> | package org.orgmode; > >>> | > >>> | public class Main { > >>> | public static void main(String[] args) { > >>> | System.out.print(Hey.say()); > >>> | } > >>> | } > >>> `---- > >>> > >>> Instead of C-c C-c, we could have added tangle headers and written > the > >>> source files out by tangling. > >>> > >>> > >>> 2.5 Example 5 > >>> ~~~~~~~~~~~~~ > >>> > >>> This prints the variable from the header > >>> > >>> ,---- > >>> | System.out.print(msg); > >>> `---- > >>> > >>> > >>> 2.6 Example 6 > >>> ~~~~~~~~~~~~~ > >>> > >>> This prints "hello, org-mode." The table is provided to the method as > >>> a list of lists. > >>> > >>> message hello, org-mode > >>> > >>> ,---- > >>> | System.out.print(tbl.get(0).get(1)); > >>> `---- > >>> > >>> > >>> 2.7 Example 7 > >>> ~~~~~~~~~~~~~ > >>> > >>> This example returns a list. > >>> > >>> Note that you're allowed to specify imports without defining the > class > >>> or main methods. > >>> > >>> ,---- > >>> | import java.util.Arrays; > >>> | > >>> | return Arrays.asList("message", "hello, org-mode"); > >>> `---- > >>> > >>> message hello, org-mode > >>> > >> > --000000000000bf332705b2253a7e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank= s for testing, and thanks for pointing that out. I will fix it so that `pub= lic` is optional.

btw, in your example you didn't have to specify `:classname` si= nce you defined the class name in the source block.

btw2, did you notice that you can = C-c C-c on source blocks that don't have main methods and it'll com= pile without error?

On Tue, Oct 20, 2020 at 3:17 PM John He= rrlin <jherrlin@gmail.com> = wrote:

Hey,

Did some debugging and found out that my class didn't contained =3Dpubl= ic=3D
and the patch requires it to be.

This works fine:

=C2=A0 =C2=A0#+HEADER: :classname Main
=C2=A0 =C2=A0#+HEADER: :dir src
=C2=A0 =C2=A0#+HEADER: :cmdline -classpath ./rxjava-1.3.8.jar:.
=C2=A0 =C2=A0#+HEADER: :cmpflag -classpath ./rxjava-1.3.8.jar
=C2=A0 =C2=A0#+BEGIN_SRC java :results output code
=C2=A0 =C2=A0 =C2=A0import rx.Observable;
=C2=A0 =C2=A0 =C2=A0public class Main {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0public static void main(String[] args) {<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Observable.range(5, 5)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.subscribe(Sy= stem.out::println);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0#+END_SRC




ian martins <ianxm@jh= u.edu> writes:

> I noticed that the tests didn't run with "make test." Th= is updates the
> patch so that they can. I didn't add java to the list of default l= anguages
> because the java tests are slow.
>
> On Mon, Oct 5, 2020 at 9:23 AM ian martins <ianxm@jhu.edu> wrote:
>
>> I wrote those examples in an org file so I could test as I wrote t= hem, and
>> then exported it to make it more readable, but the export resulted= in
>> source block headers being lost.=C2=A0 Here is the same without ex= port:
>> ----
>> * Changes
>>
>> - support for functional mode (~:results value~)
>> - accept variables
>> - don't require package, class, and main definitions
>> - write source and result tempfiles to ~org-babel-temporary-direct= ory~,
>> but respects the ~:dir~ header
>> - work with tramp
>>
>> * Examples
>> ** Example 1
>> This outputs "hello."=C2=A0 If class and main definition= s aren't given the
>> code block will be wrapped in generic ones.
>>
>> #+begin_src java :results output silent
>>=C2=A0 =C2=A0System.out.print("hello");
>> #+end_src
>>
>> This is exactly equivalent:
>>
>> #+begin_src java :results output silent
>>=C2=A0 =C2=A0public class Main {
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0public static void main(String[] args) {=
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.print("hel= lo");
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>=C2=A0 =C2=A0}
>> #+end_src
>>
>> ** Example 2
>> This also outputs "hello."
>>
>> #+begin_src java :results value silent
>>=C2=A0 =C2=A0return "hello";
>> #+end_src
>>
>> ** Example 3
>> This generates the class "Example" in the package "= org.orgmode" in the
>> current directory.
>>
>> #+begin_src java :results output silent :classname org.orgmode.Exa= mple
>> :dir .
>>=C2=A0 =C2=A0System.out.print("hello, org-mode");
>> #+end_src
>>
>> ** Example 4
>> The "Hey" class defines a static method but no main. C-c= C-c on the
>> "Hey" source block will write "./org/orgmode/Hey.ja= va" and compile it.
>>
>> The "Main" class calls the "Hey" class. C-c C-= c on the "Main" source
>> block will write "./org/orgmode/Main.java" and compile a= nd run it.
>>
>> #+begin_src java :results output silent :dir .
>>=C2=A0 =C2=A0package org.orgmode;
>>
>>=C2=A0 =C2=A0public class Hey {
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0public static String say() {
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return "hey"; >>=C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>=C2=A0 =C2=A0}
>> #+end_src
>>
>> #+begin_src java :results output silent :dir .
>>=C2=A0 =C2=A0package org.orgmode;
>>
>>=C2=A0 =C2=A0public class Main {
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0public static void main(String[] args) {=
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.print(Hey.say()= );
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>=C2=A0 =C2=A0}
>> #+end_src
>>
>> Instead of C-c C-c, we could have added tangle headers and written= the
>> source files out by tangling.
>>
>> ** Example 5
>> This prints the variable from the header
>>
>> #+begin_src java :var msg=3D"hello, org-mode" :results o= utput silent
>>=C2=A0 =C2=A0System.out.print(msg);
>> #+end_src
>>
>> ** Example 6
>> This prints "hello, org-mode." The table is provided to = the method as a
>> list of lists.
>>
>> #+name: table
>> | message | hello, org-mode=C2=A0 |
>>
>> #+begin_src java :var tbl=3Dtable :results output silent
>>=C2=A0 =C2=A0System.out.print(tbl.get(0).get(1));
>> #+end_src
>>
>> ** Example 7
>> This example returns a list.
>>
>> Note that you're allowed to specify imports without defining t= he class
>> or main methods.
>>
>> #+begin_src java :results value :exports both
>>=C2=A0 =C2=A0import java.util.Arrays;
>>
>>=C2=A0 =C2=A0return Arrays.asList("message", "hello,= org-mode");
>> #+end_src
>>
>> #+RESULTS:
>> | message | hello, org-mode |
>>
>> On Mon, Oct 5, 2020 at 8:35 AM ian martins <ianxm@jhu.edu> wrote:
>>
>>> 1 Changes
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>
>>>=C2=A0 =C2=A0- support for functional mode (`:results value'= ;)
>>>=C2=A0 =C2=A0- accept variables
>>>=C2=A0 =C2=A0- don't require package, class, and main defin= itions
>>>=C2=A0 =C2=A0- write source and result tempfiles to
>>>=C2=A0 =C2=A0 =C2=A0`org-babel-temporary-directory', but re= spects the `:dir' header
>>>=C2=A0 =C2=A0- work with tramp
>>>
>>>
>>> 2 Examples
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>> Some examples follow.=C2=A0 See the tests for more examples.= =C2=A0 I'll write
>>> proper docs after review.
>>>
>>> 2.1 Example 1
>>> ~~~~~~~~~~~~~
>>>
>>>=C2=A0 =C2=A0This outputs "hello."=C2=A0 If class and= main definitions aren't given the
>>>=C2=A0 =C2=A0code block will be wrapped in generic ones.
>>>
>>>=C2=A0 =C2=A0,----
>>>=C2=A0 =C2=A0| System.out.print("hello");
>>>=C2=A0 =C2=A0`----
>>>
>>>=C2=A0 =C2=A0This is exactly equivalent:
>>>
>>>=C2=A0 =C2=A0,----
>>>=C2=A0 =C2=A0| public class Main {
>>>=C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0public static void main(Strin= g[] args) {
>>>=C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= t("hello");
>>>=C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0}
>>>=C2=A0 =C2=A0| }
>>>=C2=A0 =C2=A0`----
>>>
>>>
>>> 2.2 Example 2
>>> ~~~~~~~~~~~~~
>>>
>>>=C2=A0 =C2=A0This also outputs "hello."
>>>
>>>=C2=A0 =C2=A0,----
>>>=C2=A0 =C2=A0| return "hello";
>>>=C2=A0 =C2=A0`----
>>>
>>>
>>> 2.3 Example 3
>>> ~~~~~~~~~~~~~
>>>
>>>=C2=A0 =C2=A0This generates the class "Example" in th= e package "org.orgmode" in the
>>>=C2=A0 =C2=A0current directory.
>>>
>>>=C2=A0 =C2=A0,----
>>>=C2=A0 =C2=A0| System.out.print("hello, org-mode"); >>>=C2=A0 =C2=A0`----
>>>
>>>
>>> 2.4 Example 4
>>> ~~~~~~~~~~~~~
>>>
>>>=C2=A0 =C2=A0The "Hey" class defines a static method = but no main. C-c C-c on the
>>>=C2=A0 =C2=A0"Hey" source block will write "./or= g/orgmode/Hey.java" and compile it.
>>>
>>>=C2=A0 =C2=A0The "Main" class calls the "Hey&quo= t; class. C-c C-c on the "Main" source
>>>=C2=A0 =C2=A0block will write "./org/orgmode/Main.java&quo= t; and compile and run it.
>>>
>>>=C2=A0 =C2=A0,----
>>>=C2=A0 =C2=A0| package org.orgmode;
>>>=C2=A0 =C2=A0|
>>>=C2=A0 =C2=A0| public class Hey {
>>>=C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0public static String say() {<= br> >>>=C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return "he= y";
>>>=C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0}
>>>=C2=A0 =C2=A0| }
>>>=C2=A0 =C2=A0`----
>>>
>>>=C2=A0 =C2=A0,----
>>>=C2=A0 =C2=A0| package org.orgmode;
>>>=C2=A0 =C2=A0|
>>>=C2=A0 =C2=A0| public class Main {
>>>=C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0public static void main(Strin= g[] args) {
>>>=C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= t(Hey.say());
>>>=C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0}
>>>=C2=A0 =C2=A0| }
>>>=C2=A0 =C2=A0`----
>>>
>>>=C2=A0 =C2=A0Instead of C-c C-c, we could have added tangle hea= ders and written the
>>>=C2=A0 =C2=A0source files out by tangling.
>>>
>>>
>>> 2.5 Example 5
>>> ~~~~~~~~~~~~~
>>>
>>>=C2=A0 =C2=A0This prints the variable from the header
>>>
>>>=C2=A0 =C2=A0,----
>>>=C2=A0 =C2=A0| System.out.print(msg);
>>>=C2=A0 =C2=A0`----
>>>
>>>
>>> 2.6 Example 6
>>> ~~~~~~~~~~~~~
>>>
>>>=C2=A0 =C2=A0This prints "hello, org-mode." The table= is provided to the method as
>>>=C2=A0 =C2=A0a list of lists.
>>>
>>>=C2=A0 =C2=A0 message=C2=A0 hello, org-mode
>>>
>>>=C2=A0 =C2=A0,----
>>>=C2=A0 =C2=A0| System.out.print(tbl.get(0).get(1));
>>>=C2=A0 =C2=A0`----
>>>
>>>
>>> 2.7 Example 7
>>> ~~~~~~~~~~~~~
>>>
>>>=C2=A0 =C2=A0This example returns a list.
>>>
>>>=C2=A0 =C2=A0Note that you're allowed to specify imports wi= thout defining the class
>>>=C2=A0 =C2=A0or main methods.
>>>
>>>=C2=A0 =C2=A0,----
>>>=C2=A0 =C2=A0| import java.util.Arrays;
>>>=C2=A0 =C2=A0|
>>>=C2=A0 =C2=A0| return Arrays.asList("message", "= hello, org-mode");
>>>=C2=A0 =C2=A0`----
>>>
>>>=C2=A0 =C2=A0 message=C2=A0 hello, org-mode
>>>
>>
--000000000000bf332705b2253a7e--