1

I have some Java's scripts in a org file. And I use meghanada-mode in java-mode.

Each time I open this org file and do nothing, I get the following error since the mehanada server loaded by java-mode can't not find a project root for these scripts

Meghanada-Server Starting ...
error in process sentinel: meghanada--server-process-sentinel: Error:meghanada-server process stopped: finished
. Please check *meghanada-server-log* buffer

It seems that even I just open the org file org mode has already load all the major modes from org babels.

How can I prevent (or fix) this? I only want org load these things until I call C-c '.

1
  • There are mutliple layers in the onion and you'll need to unravel them one by one. First, decouple the Org mode file question from the java question: restart your emacs, open a java file and see if you get the error. If you get an error, check the *meghanada-server-log* buffer and see what it says. Edit your question and add this information. If you don't get an error, then check the value of org-babel-load-languages: add that information to your question. Those are the first steps: let's see what you get and we'll go from there.
    – NickD
    Dec 14, 2021 at 15:46

1 Answer 1

0

You should take a look at the function org-babel-do-load-languages. I think you'll want something like this:

(org-babel-do-load-languages
 'org-babel-load-languages
 '((python . t)
   (C . t)
   (calc . t)
   (latex . t)
   (java . t)
   (ruby . t)
   (lisp . t)
   (scheme . t)
   (shell . t)
   (sqlite . t)
   (js . t)))

Just change the 't' to 'nil' for those you don't want.

3
  • I don't have (java . t) in it, but it still loads. Jun 3, 2018 at 4:01
  • Do you have (java . nil) ?
    – mclear
    Jun 3, 2018 at 16:21
  • No, I don't.... Jun 4, 2018 at 2:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.