
# and your additional classes will be picked up by springboot # of fat_app.jar is set to ' .JarLauncher ' # It should work now, even though the main class in manifest The solution is to go the old java way and provide the main class yourself: run via the following command java -jar fat_app.jar We wanted to add a jar, without changing the pom.xml
Intellij jar classpath zip#
change pom.xml as follows spring-boot-maven-plugin ZIP

Solution as of now is to modify the pom.xml and change to Properties launcher i.e. Since springboot when using JarLaunhcer, ignores -classpath or -cp argument of java, our attempt to add a jar via -cp argument fails. we would launch the springboot app using the following command java -jar fat_app.jar Don’t forget to submit your feedback regarding this feature in IntelliJ IDEA.We had a scenario where we were using the JarLauncher of springboot but had to add additional jars to classpath.
Intellij jar classpath full#
Starting with IntelliJ IDEA 2017.3 you can preview the full command line if a long classpath was shortened via classpath.jar (JAR Manifest option in Run/Debug Configuration dialog box). Up until now, when the IDE shortened the classpath via classpath.jar, you would see only the classpath of the temporary jar: -classpath C:\Users\jetbrains\AppData\Local\Temp\classpath.jar. If you want the team to have the same experience, it’s advised to explicitly set this option. The only exception is for the parameter User-local default: this parameter won’t be shared if the configuration itself is shared. IntelliJ IDEA 2017.3 enables you to share your configuration with your colleagues, so all team members will have the same behavior for the application/tests, even on different operating systems. You can set up a default way to shorten the command line and use it as a template for further configurations. So you will have User-local default: none – if nothing was specified for the classpath shortener before, User-local default: JAR Manifest – if your settings specified the shortener via classpath, and User-local default: classpath file: – if your settings specified the shortener through the text file. The IDE will configure this setting, depending on the value of the properties set in: idea/workspace.xml file, property: “dynamic.classpath” and /options/options.xml file, property: “”. This option is set automatically for projects created before this EAP. The Original classpath is defined inside MANIFEST.MF as a Class-Path attribute in classpath.jar.Ĭlasspath file: The IDE will write a long classpath into a text file. JAR Manifest: The IDE passes the long classpath via a temporary classpath.jar. If the command line exceeds the OS limitation, the IDEA will not be able to run your application, but the tooltip will suggest configuring the shortener. The IDE doesn’t shorten the long classpath. The new field allows you to choose the way the IDE will shorten the command line from a drop-down list: In the Run/Debug Configuration dialog, a new field appeared: Shorten command line. IntelliJ IDEA 2017.3 provides a convenient way to specify the method to shorten command line, for each configuration. Starting with v2017.3, there is no more need to edit the settings of your IDE through the XML files. For Application, JUnit and TestNG configurations, v2017.3 provides a way to configure the shortener. So the user is left having to make this decision.

Unfortunately, that didn’t work either, for some other frameworks.Īnd, sadly, there is no way to predict which kind of shortening would work for the user application. Then, IntelliJ IDEA tried to use a more or less standard way, which was to pack the long classpath into the classpath.jar. But unfortunately, this didn’t work for some frameworks, e.g. Initially, IntelliJ IDEA tried to write the long classpath into the text file (which means an intermediate classloader to the application). There are several approaches to shorten the classpath.

In such cases IntelliJ IDEA will try to shorten the classpath. The reason is that most operating systems have a command line length limitation. When the classpath gets too long, or you have many VM arguments, the program cannot be launched.
Intellij jar classpath how to#
Let’s take a closer look at when and how to use this feature.

In IntelliJ IDEA, it’s possible to configure a command-line shortener.
