mahmood
mahmood

Reputation: 24705

debug/optimize java application

Is there any optimized and debug mode for a java code? Using GCC, it is possible to add debug symbols via -g -ggdb to the binary for debugging purposes and remove them by adding -O option to maximize the speed.

What about Java? I am using Maven (pom.xml). I can not find such option for Java

Upvotes: 1

Views: 171

Answers (1)

Peter Walser
Peter Walser

Reputation: 15706

Java compiler options can be specified in the Maven Compiler Plugin.
Example: excluding debug information, enabling optimization:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.4</version>
    <configuration>
      <debug>false</debug>
      <debuglevel>none</debuglevel>
      <optimize>true</optimize>
    </configuration>
  </plugin>

A complete list of configuration options can be found here.

Upvotes: 1

Related Questions