So most basic weapons require the following (and in the proper locations)- also all of this is case-sensitive when on OSX/Linux:
- .wpn files
- the .proj files of the projectiles they shoot
- the sound effect entries from sounds.json
- the sfx files referenced by sounds.json entries
- the appropriate entries from weapon_data.csv.
More complex modded weapons may require the following .java files (and in the proper locations):
- OnHitEffectPlugins or BeamEffectPlugins... these are referenced in the .wpn/.proj files
- Custom weapon/missile AI scripts... these are typically loaded by a mod's ModPlugin scripts
- Custom combat layer plugins... these are typically loaded by settings.json.
- Utility functions from GraphicsLib / LazyLib (these mods just need to be present and active)
- Other scripts... the above are not the only way for mods to load custom bits of code for weapons and whatnot, many modders can be particularly crafty
.java code needs to be placed in the proper location (hint: in the package location mentioned in first line of each .java file), where it gets compiled by the Janino JIT compiler. Unfortunately some Java 7 language features cannot be compiled by Janino (namely, generics... they typically looks something like this: code<GenericType>), and must be compiled by an actual Java compiler into a .jar archive... see this tutorial here:
http://fractalsoftworks.com/forum/index.php?topic=10057.0. Most mods readily provide their source code in a directory called src/. For the ones that don't (namely, DarkRevenant's stuff), you can rip the .java source code from their .jar files by simply unzipping it. Alternatively, IntelliJ IDEA can open and decompile pretty much any .jar file it comes across. I also know a guy who swears by the CFR decompiler - apparently it's absolutely fabulous.
Hope this helps! I'd suggest starting with some relatively simple weapons that do not require Java code before moving on to the tough stuff.