When I build a Jar in intellij (using "build artifacts...") it generates a jar that has invalid signature.
To solve it I always need to go inside the jar to META-INF folder and delete ORACLE_J.SF and ORACLE_J.RSA.
Any idea why it happens/how to solve it?
Related
How do you change the classpath to a jar file or a different directory?
Go to File-> Project Structure-> Libraries and click green "+" to add the directory folder that has the JARs to CLASSPATH. Everything in that folder will be added to CLASSPATH. Update: It's 2018. It's a better idea to use a dependency manager like Maven and externalize your dependencies. Don't add JAR files to your project in a /lib folder anymore.
I am attempting to add an external jar to my module's build path. I've added the jar as a module dependency and as a library, and the compiler is still unable to find the jar. I'm using intelliJ 14.1. I have verified that the jar is intact and not corrupt.
JAR manifest: IntelliJ IDEA will pass a long classpath via a temporary classpath.jar. The original classpath is defined in the manifest file as a class-path attribute in classpath.jar . You will be able to preview the full command line if it was shortened using this method, not just the classpath of the temporary classpath.jar .
I have a gradle based kotlin/java project using intellij IDEA for development.
As the project is gradle based all build artefacts are under gradles build/ directory|folder.
But there are also all .kt and .class files under <projectRoot>/bin
Does Intellij need to have these there?
I could not find anything in the project neither in intellij settings, nor did google searches enlighten me on this.
how to tell Intellij to work with the gradle build artefacts files under build/ and not to produce files under bin/ dir ???
I opened the project in eclipse now and then ... and Eclipse compiled to bin/.
So it wasn't Intellij at all ...
I apologise for the inconveniences
I have multi-project web application that configurable by Gradle. In one subproject (let's call it 'XYZ') I specify desired jar-file name.
jar {
archiveName 'archiveName.jar'
}
When I import this project into IntelliJ IDEA (File -> New -> Project from Existing Sources...), IntelliJ IDEA generate artifact description for WAR file. In this artifact description subproject JAR file in WEB-IBF/lib named as <rootProject.name>-XYZ.jar.
How to force IntelliJ IDEA to use the name of the jar-file specified in the gradle.build as artifact name?
Delegate the build to Gradle or use Gradle tasks to build the artifacts instead of IntelliJ IDEA. Vote for the related request.
I am trying to create a jar in IntelliJ through maven clean-compile-package. Build is sucessful but I am not getting class and packages in tha jar. Please help! I got below warning in logs:
[WARNING] JAR will be empty - no content was marked for inclusion!
maven project have default standard directory layout its documented here
if you not followed them or moved folders around, maybe changed output folder or similar action was taken, maven can't correctly decide how to include your class files.
I have a module for which I want a jar to be created. So, here is what I do:
Adding a jar artifact, using the "From module with dependencies ..." option
In "Jar files from libraries" I select "copy to the output directory and link via manifest"
Leave all the defaults.
After that I can build the jar and all the dependencies would be placed near it in the same directory. So far so good.
Now I wish all the dependencies to be placed in a separate directory near the final jar. So, I repeat the same steps, but this time I create a new directory under the node in the artifact Output Layout tab (using the "Create Directory" button). Next I drag all the dependencies onto the new folder and apply the changes.
On the surface, everything is cool - the dependencies are indeed placed in the dedicated directory, but the MANIFEST.MF file is never updated! It should reference the dependencies via the new directory. As of now, the produced jar cannot be run - its dependencies are not visible.
This is unlike Eclipse, which does make sure the manifest file is correct when exporting a project as jar.
How can I workaround this problem, given that:
I want all the dependencies in a dedicated folder.
I want to use IntelliJ IDEA
I do not want to edit the manifest file manually.
I am using the latest download of the IntelliJ IDEA for windows - 11.1.2, build 117.418
Thanks.
At the moment you have to update the classpath manually in the artifact configuration dialog so that it includes the subdirectory:
I've created an issue for this limitation, please star/vote.