David Gillooly | 7 Jul 2012 18:30
Picon
Gravatar

How to Compile Java from MacVim and Show Output in Terminal

I am taking a beginning Java class that just uses a text editor and shell to create java files,compile them
and run them from a terminal that shows the results. This is basic java stuff. Beginning java for idiots level!

I want to use MacVim to create, compile, and run the Java exercises and examples.

I can write java from MacVim and get the proper highlighting etc. However I have not been able to figure out
how to compile the editor to allow me to compile and run the programs.

What does one have to do? [make does't work for me]

Thanks..Dave

--

-- 
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Xiao G. Wu | 9 Jul 2012 07:37
Picon
Gravatar

Re: How to Compile Java from MacVim and Show Output in Terminal

I would offer that you write to file,
type :shell
javac ?.java
java ?
type exit to return to the editor

Sent from my iPad

On Jul 7, 2012, at 1:25 PM, David Gillooly <david.gillooly@...> wrote:

> I am taking a beginning Java class that just uses a text editor and shell to create java files,compile them
and run them from a terminal that shows the results. This is basic java stuff. Beginning java for idiots level!
>
> I want to use MacVim to create, compile, and run the Java exercises and examples.
>
> I can write java from MacVim and get the proper highlighting etc. However I have not been able to figure out
how to compile the editor to allow me to compile and run the programs.
>
> What does one have to do? [make does't work for me]
>
> Thanks..Dave
>
> --
> You received this message from the "vim_mac" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

--

-- 
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
(Continue reading)

David Gillooly | 24 Aug 2012 00:09
Picon
Gravatar

Re: How to Compile Java from MacVim and Show Output in Terminal

On Sunday, July 8, 2012 10:37:16 PM UTC-7, Xiao G. Wu wrote:
> I would offer that you write to file,
> 
> type :shell
> 
> javac ?.java
> 
> java ?
> 
> type exit to return to the editor
> 
> 
> 
> Sent from my iPad
> 
> 
> 
> On Jul 7, 2012, at 1:25 PM, David Gillooly
<david.gillooly@...> wrote:
> 
> 
> 
> > I am taking a beginning Java class that just uses a text editor and shell to create java files,compile them
and run them from a terminal that shows the results. This is basic java stuff. Beginning java for idiots level!
> 
> >
> 
> > I want to use MacVim to create, compile, and run the Java exercises and examples.
> 
> >
(Continue reading)

Peter Palmreuther | 9 Jul 2012 08:53
Picon
Gravatar

Re: How to Compile Java from MacVim and Show Output in Terminal

Hi,

Am 07.07.2012 um 18:30 schrieb David Gillooly:
> 
> I am taking a beginning Java class that just uses a text editor and shell to create java files,compile them
and run them from a terminal that shows the results. This is basic java stuff. Beginning java for idiots level!
> 
> I want to use MacVim to create, compile, and run the Java exercises and examples.
> 
> I can write java from MacVim and get the proper highlighting etc. However I have not been able to figure out
how to compile the editor to allow me to compile and run the programs.
> 
> What does one have to do? [make does't work for me]

Create or open your Java source code file in MacVim, if necessary use 

:setlocal filetype=java

to get proper syntax highlighting and finally 

:setlocal makeprg=javac\ %

Now when you want to compile your Java class just type

:make

It will execute "javac YourClass.java" (assuming your file name is "YourClass.java").
You'll get a list of warnings or errors, if any, the same way vim would present it for a C project.

To execute your Java program type
(Continue reading)

David Gillooly | 24 Aug 2012 00:12
Picon
Gravatar

Re: How to Compile Java from MacVim and Show Output in Terminal

On Sunday, July 8, 2012 11:53:42 PM UTC-7, Peter Palmreuther wrote:
> Hi,
> 
> 
> 
> Am 07.07.2012 um 18:30 schrieb David Gillooly:
> 
> > 
> 
> > I am taking a beginning Java class that just uses a text editor and shell to create java files,compile them
and run them from a terminal that shows the results. This is basic java stuff. Beginning java for idiots level!
> 
> > 
> 
> > I want to use MacVim to create, compile, and run the Java exercises and examples.
> 
> > 
> 
> > I can write java from MacVim and get the proper highlighting etc. However I have not been able to figure out
how to compile the editor to allow me to compile and run the programs.
> 
> > 
> 
> > What does one have to do? [make does't work for me]
> 
> 
> 
> Create or open your Java source code file in MacVim, if necessary use 
> 
> 
(Continue reading)


Gmane