Reputation: 23104
I have import a directory in Intellij idea 13 with the following file structure:
gtransapi/
├── .idea
│ ├── .name
│ ├── artifacts
│ │ └── gtransapi_jar.xml
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── gtransapi.iml
│ ├── misc.xml
│ ├── modules.xml
│ ├── scopes
│ │ └── scope_settings.xml
│ ├── vcs.xml
│ └── workspace.xml
└── src
└── com
└── gtranslate
├── Audio.java
├── Language.java
├── Main.java
├── Translator.java
├── URLCONSTANTS.java
├── parsing
│ ├── Parse.java
│ ├── ParseTextDetect.java
│ └── ParseTextTranslate.java
├── text
│ ├── Text.java
│ └── TextTranslate.java
└── utils
└── WebUtils.java
10 directories, 22 files
This is a library for using google's translate service. I want to build it into a jar file for distribution, but can't make it work.
build jar file from module in Intellij Idea 13
file -- project structure -- artifacts -- + -- jar -- from modules with dependencies -- fill "Main" in the main class field.
Then build -- build artifacts. The status bar says build successful, but when I inspect it from intellij, it is almost empty:
(source: p.im9.eu)
Any ideas?
Upvotes: 1
Views: 1675
Reputation: 1332
open your project , go to file menu , click on the project structure and go to the artifacts,click on '+' and click on jar and choose From "Modules to dependencies" then declare your Main class with browse button (Search By Name Tab) to added jar file then Press Ok, 3 Step Remaining : Rebuilt your project -> generate your Ant build then build Artifacts then click on your jar file and Enjoy! tested with Intellij Idea 13.1.4
Upvotes: 1