![]() Wizards, code generation, and management tools.Net beans is a free open source, cross-platform IDE with built-in support for Java. Examples of IDEs include, Eclipse, My eclipse, RAD, Jboss, Netbeans, etc. It is a place where we can design the page, write the source code, debug the source code, compile and execute the code. Nmap :set makeprg=ant\ -quiet\ -buildfile\ /home/ivan/data/java/netbeans/artificialidea/build.IDE Stands for integrated development environment. Nmap :w:!ant -e -buildfile /home/ivan/data/java/netbeans/artificialidea/build.xml clean Nmap :w:cd ~data/java/src:let &makeprg = "ant -quiet -buildfile ~data/java/netbeans/my_domain/build.xml -Djavac.includes=". To add the compilation only of the current file: You also don't need the -emacs if you set the output format in the build script to it. You could also do a hardcoded path if you like, I just use many different build files so this helps. That one will just look upwards from the current directory until it finds a file called build.xml and use that as the build file. Set makeprg=ant\ -emacs\ -find\ build.xml\ So as long as you set your makeprg var correctly you should be able to use quickfix with it. ![]() Vim has a default built in for ant that will read it correctly. You shouldn't need to explicitly set the error format. Note: The above code works pretty well, but if there are no errors, ":clist" returns a few ones, what means that "set efm=." isn't perfect. Set makeprg=ant\ -quiet\ -buildfile\ ~/data/java/netbeans/my_domain/build.xml\ compile To use quickfix (for compiling and jumping automatically to errors), one can set: Instead of mapping F6 to a direct ant call, I would suggest setting ant as your makeprg and set the errorformat so that you can utilize the quickfix window to easily jump to compilation errors. Modern-day Netbeans (currently at version 7.3 in 2013) has an excellent vim plugin: just search for "jVi for Netbeans", and download the plugin either from sourceforge or from the netbeans plugin portal. And you can start anytime Netbeans for debugging, refactoring, etc. That's it! Now you can compile changed files pressing or execute the class you are editing with in Vim. Nmap :cd ~/data/java/src:! ant -buildfile ~/data/java/netbeans/my_domain/build.xml -Drun.class=%.:r -Djavac.includes=~/data/java/netbeans/my_domain/build/classes/ run-single:cd %:p:h Nmap :! ant -buildfile ~/data/java/netbeans/my_domain/build.xml compile vimrc or in ~/.vim/ftplugin/java_netbeans.vim or: Step 3: Compile your project with Netbeans. Netbeans will add packages in the project for all subdirectories, which allows to move classes between packages with the mouse, and Netbeans will refactor your whole source files for you. The source code directory should be the top directory, here: "~/data/java/src". ![]() Let say "~/data/java/netbeans" and the project name is "my_domain". At this point you can choose within Netbeans where all project files will be saved. Step 2: Install Netbeans and create a new project with existing sources. For example the package com.your_domain.util is in the directory "~/data/java/src/com/your_domain/util" It is assumed that your Java source code is in the directory "~/data/java/src" and that your classes are in different packages below this directory. Netbeans can then be started any time to do things that Vim cannot, like debugging in a GUI or refactoring. This tip explains how to configure Vim to build Java sources and to execute classes without having to start Netbeans, but everything done in the same way Netbeans would do it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |