How to create a new Splunk SDK for Java project type

The Splunk® SDK for Java project wizard creates a project with the Splunk SDK for Java's JAR file already included and added to the project's class path. The project wizard also optionally adds support for CSV and JSON parsing and logging to Splunk Enterprise with Logback, Log4j, or java.util.logging.

To create a new Splunk SDK for Java project:

  1. On the File menu, point to New, and then click Project.

  2. In the New Project window, expand the Splunk category and click Splunk SDK for Java project. Then click Next.

    Screen shot of the Java New Project wizard
  3. In the Splunk SDK for Java project wizard, enter a name for your project. Optionally, set additional preferences:

    1. Set any Java project preferences—JRE, project layout, and working sets—you want. When setting a JRE, keep in mind that the Splunk SDK for Java supports Java 1.6 and later.

    2. If you want to add support for JSON or CSV parsing, select the corresponding check box in the Add optional Splunk data format support section.

    3. If you want to add logging support, in the Add support for logging libraries section, select Add logging support, and then choose the type of logging support you want to use.

    Click Next if you want to change the default project build settings, or click Finish if you're done.

    Screen shot of the Java New Project wizard
  4. Your new project's workspace opens automatically. (If you don't see it, close the Welcome page and any other projects you have open.)

Note  If you don't know whether you need Splunk Enterprise support for JSON or CSV, you probably don't. The default format in Splunk Enterprise is XML. Similarly, if you're not planning to use a Java logging framework, you don't need logging support. If you are planning to use one, selecting the logging framework you want will add the JAR files for the framework, the JAR files for SLF4J for that framework, and a logging configuration file set to write its logs to a Splunk Enterprise TCP input.