[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h-e-w] compile java with emacs on PC?

From: Ken Goldman
Subject: Re: [h-e-w] compile java with emacs on PC?
Date: Mon, 2 Dec 2002 16:57:04 -0500

Ages ago, I had this in my .emacs.

(defun kgold-setup-java ()
  (make-local-variable 'compile-command)
  (setq compile-command (concat "javac " (file-name-nondirectory 
(add-hook 'java-mode-hook 'kgold-setup-java)

Then M-x compile would run the javac compile.

Eventually, I realized that makefiles are a more general solution, so
I create simple makefiles for java code and let emacs default to
running make.

To assign it to a single key stroke:

(global-set-key [pause]      'compile)

And the bonus you asked for, M-x next-error can be used to step
through the errors, bringing you to the correct file and line.
It works for java, C, ...

(global-set-key [C-pause]    'next-error)

> From: "Scott Purcell" <address@hidden>
> Date: Mon, 2 Dec 2002 15:02:05 -0600
> I am running win2000 and I am working with java source files. It
> would be nice if I could compile and run class files from emacs, but
> I do not think it is do-able?
> I did figure out I can compile by going under "tools/compile" then
> type in javac  That works, but is there a quick-key
> to the compile function? I get tired of using the mouse. Also can we
> run a java file from here in a new frame? I don't think so, but I
> thought I would ask. And while I am asking, is there anything else
> cool emacs can do as far as compiling java files that someone could
> pass along?

Ken Goldman   address@hidden   914-784-7646

reply via email to

[Prev in Thread] Current Thread [Next in Thread]