Next: , Previous: Arduino Features, Up: Top


11 Java Features

If you are using CEDET with Java, then there are a few Java specific options you may need to configure for your system.

11.1 Java programs

You can configure CEDET to use programs from the JDK, such as java and javap.

— Variable: cedet-java-command

The command for running the java program.

— Variable: cedet-javap-command

The command for running the javap program. This program is used by semantic to extract symbols from Jar files.

11.2 Using JAR files for Semantic data

Semantic can use your system Jar files to look up data for smart completion and other uses. To enable the system, you need to use the javap extension for semanticdb. To do that, require the semantic javap database in your .emacs file

     (require 'semantic/db-javap)

11.3 System Class Path

In order for semantic to find your sources, or jar files for use with the javap database extension, you need a way to customize the classpaths used.

You can do that through a couple variables, and through EDE.

— Variable: cedet-java-classpath-extension

List of extended classpath directories and Jar files to pass to java commands. This will affect ALL calls to java and javap that CEDET makes so that java programs will use those libraries. This path is ignored when semantic looks up files.

— Variable: semanticdb-javap-classpath

List of extended classpath directories and Jar files used by semantic/db-javap when searching for classes. This classpath is NOT passed to java when invoking java commands.

11.4 EDE Setup

For large Java programs, it is important to setup EDE for it. While EDE can be used to create Makefiles or use Automake files for several languages, EDE also provides a way to merely describe a project so that tools like semantic can find your sources.

If you are programming for Android, then there is already a special EDE project type for that. See Android Features for more.

If you aren't programming with a supported EDE Java projec type, you can identify your build system with the very simple ede-java-root-project type. To use it, add this to your .emacs file, or other configuration:

     (global-ede-mode 1) ;; Enable EDE
     (ede-java-root-project "SOMENAME" :file "/dir/to/some/file")

where SOMENAME is a name for this project, and the file is a file or directory name that exists at the root of your java project directory. There are also options for customizing your classpath, both for the system, and local to your project. For more on this option, including class path settings see the ede-java-root chapter.