emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: uruseiiyatsura <uruseiiyatsura@protonmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: [BUG] Possible Outdated Documentation, Possible Bug. "Can't compile a java block without a classname." Org-babel babel java
Date: Wed, 22 Sep 2021 02:06:18 +0000	[thread overview]
Message-ID: <UT6T2iOXtO0dMWc5QA4ZPbG0yh-4wOprgsHAe91c_wf7DwDKdLoJilTWK50rJuz8cNxtwrlTc_CpQIGBpQixTjDPnCJfq-WQKhk4oFLed_I=@protonmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]

[Java Source Code Blocks in Org Mode](https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-java.html) says the following:

"It is not necessary to include the class statement or define a main method. ob-java will wrap a source code block in boilerplate class and main method definitions if they are omitted. If :classname and the class definition in the source code block are both omitted, the class will be named Main."

The following example is provided:

#+begin_src java :results output
System.out.print("hello, world");
#+end_src

This returns error "can't compile a java block without a classname." This contradicts the documentation.

This has been duplicated on Gentoo and Ubuntu 20.04 in Emacs version 27.2. org version 9.4.4, 9.4.6 and 26.3 9.1.9 using the following .emacs.el:

(require 'org)
(org-babel-do-load-languages
'org-babel-load-languages
'(
(java . t)
))

The documentation appears to be outdated or misleading, or missing some crucial piece of information that a newbie needs to be aware of. Please advise on whether this is a bug and how to fix it. I am new to using the mailing list.

Upgrading to 9.4.6 did not fix this

[-- Attachment #2: Type: text/html, Size: 1680 bytes --]

             reply	other threads:[~2021-09-22  2:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22  2:06 uruseiiyatsura [this message]
2022-10-20  2:58 ` [BUG] Possible Outdated Documentation, Possible Bug. "Can't compile a java block without a classname." Org-babel babel java Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='UT6T2iOXtO0dMWc5QA4ZPbG0yh-4wOprgsHAe91c_wf7DwDKdLoJilTWK50rJuz8cNxtwrlTc_CpQIGBpQixTjDPnCJfq-WQKhk4oFLed_I=@protonmail.com' \
    --to=uruseiiyatsura@protonmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).