Sunday, July 31, 2011
How to reference a .jar file in an intelij project.
I've been using IntelliJ to develop my Android game Bugsy. It's been excellent but when I started trying out Flurry I found referencing external .jar files to be a bit of a pain. It's really not obvious how to do this basic task.
I've tried a few different ways which seems to work but once my laptop was rebooted the compiler no longer finds the jar. After a few rounds of trial and error here is a procedure that has stuck!
Rebuild the project and get on with doing something much more fun!!
I've tried a few different ways which seems to work but once my laptop was rebooted the compiler no longer finds the jar. After a few rounds of trial and error here is a procedure that has stuck!
- Create a folder in your project ('jars' for example and drop the .jar file in there).
- Open Project structure dialog (you can tooltip-hunt the button but ctrl+alt+shift+s is easier).
- Click "Modules" on the left.
- Click the "Dependencies" Tabs
- Click the Add... button
- Choose 1. Single-Entry Module Library
- Browse your project for the file .jar file and select it
- Click OK then OK again to close the project structure.
Rebuild the project and get on with doing something much more fun!!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment