April 18, 2016 at 4:34 am #34
I’m a .NET developer trying to learn more about the wonderful world of Java. JPad is an awesome tool and it’s been helpful. I use LinqPad all the time to test things out and it’s been great to have JPad because it’s so similar. You’ve really done a nice job with this.
I was looking at some of the example scripts and I saw the ones that use guava. I was wondering how the import of the guava classes works because I don’t see where the actual .jar files for guava are located. I installed JPad using the Windows installer and it comes with the JDK but I don’t see any guava .jar files in any of the JPad folders and I know I haven’t installed any guava files myself so I’m wondering where that comes from. I’m used to the .NET world where we reference a .dll to bring it into our project. I even have to do this with LinqPad so I’m wondering how this is working for guava.
I know that this is kind of a noob question but I’ve been searching online for a little while and I can’t seem to find an answer to this. I’d appreciate any help you could give or a point in the right direction of what to search for. Thanks!April 18, 2016 at 7:46 am #35
Great to hear you are enjoying jpad!
The guava/apache libraries are bundled with the jpad jar. On windows if you look at:
C:\Program Files (x86)\TimeStored.com\JPad\jpad.jar
You can actually open that file as a zip file using something like 7zip. Inside is bundled the code for jpad but also a bunch of other libraries. Namely:
– Mysql/H2/postgresql/mssql JDBC drivers
I made this jar using ants zipgroupfileset, but I believe you can do similar with onejar http://one-jar.sourceforge.net/.
This could end up being a controversial decision as it ties standard jpad use to specific deployed versions, versus the user choosing a specific jar but I consider the added convenience worthwhile. Basically jpad has a massive ordered list of classes which when it sees them auto imports according to that list. Compared to other IDEs that suggest a package based on name, I want to be a bit smarter and go on what methods are called plus the popularity of the library.
It annoys the hell out of me when eclipse suggests something else for List<> than java util list!
I intend to add the ability to add user specified jar’s soon.
You must be logged in to reply to this topic.