
- #INTELLIJ JAR FILE NOT BUILDING HOW TO#
- #INTELLIJ JAR FILE NOT BUILDING CODE#
- #INTELLIJ JAR FILE NOT BUILDING LICENSE#
If you have a pure Java or a Kotlin project we recommend that you use IntelliJ IDEA to build your project since IntelliJ IDEA supports the incremental build which significantly speeds up the building process. You can compile a single file, use the incremental build for a module or a project, and rebuild a project from scratch. IntelliJ IDEA uses a compiler that works according to the Java specification. The IntelliJ IDEA compilation and building process compiles source files and brings together external libraries, properties files, and configurations to produce a living application.
#INTELLIJ JAR FILE NOT BUILDING CODE#
(See Recipe 18.1 for easy ways to do this.) Then place the following code in a file named Main.Compile and build applications with IntelliJ IDEA This is easily demonstrated.įirst, create an empty SBT project directory. This is because class files in the JAR file created by sbt package have dependencies on Scala class files (Scala libraries), which aren’t included in the JAR file SBT generates. DiscussionĪ JAR file created by SBT can be run by the Scala interpreter, but not the Java interpreter.
#INTELLIJ JAR FILE NOT BUILDING LICENSE#
This can be important if there are license restrictions on a JAR file, for instance.Īs noted, there are other plug-ins to help solve this problem, including One-JAR, but sbt-assembly worked best with several applications I’ve deployed as single, executable JAR files. The sbt-assembly plug-in works by copying the class files from your source code, the class files from your dependencies, and the class files from the Scala library into one single JAR file that can be executed with the java interpreter. Packaging target/BlueParrot-assembly-1.0.jar. Including applescriptutils_2.9.1-1.0.jar Now run sbt assembly to create your single, executable JAR file: See the sbt-assembly project documentation for the latest version and configuration information. The installation instructions for sbt-assembly will probably change, but at the time of this writing (May, 2018), just create a file named assembly.sbt in your SBT project directory with this line:ĪddSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")Īfter that, just reload your SBT project. The first two approaches are examined in the Discussion. This solution focuses on the third approach. This requires that Java is installed on client systems.
#INTELLIJ JAR FILE NOT BUILDING HOW TO#
Read the background for more background information, or skip ahead to the “Using sbt-assembly” section for details on how to use sbt-assembly. The solution is to use the sbt-assembly plugin. You’re building a Scala application, such as a Swing application, and want to deploy a single, executable JAR file to your users. This is Recipe 18.14, “How to Deploy a Single, Executable JAR File.” Problem This is an excerpt from the Scala Cookbook (partially modified for the internet). par, and performanceĪny donation (through ) will help keep this site running show more info on classes/objects in repl.
