How to add jasypt plugin to eclipse - java

So I am using
Eclipse IDE for Java EE Developers
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplerrc3
and I am trying to add the jasypt - 1.9.0 plugin to eclipse
Since I am not experienced in this, I only tried one way which is
1- Download the zip file form the following url
http://sourceforge.net/projects/jasypt/files/
2- Unzip the file into the eclipse subdirectory plugins
3- Restart eclipse
However it seems that there is something missing

Go to your downloaded file and go to the lib folder. In there, you have a whole host of jar files. It is most likely the jasypt-1.9.0 jar you want.
In Eclipse: go to: Properties > Java Build Path > Libraries
Choose to add an External Jar and navigate to the location of the jasypt-1.9.0.jar
This will add the jar and its libraries to your project. Note: Look at the API for what you are using if this doesn't work - you may require a different jar to be imported instead/as well.
This is the standard way to add any third-party libraries to your project.

Related

Add AWS SDK to IntelliJ project without Maven or Gradle

I'll start this off by saying that I'm not a Java dev, I work in a .NET software house, but somehow we have ended up needing to modify some legacy java code.
So I have a project which I've opened up with IntelliJ IDEA Ultimate 2016.2. As far as I can tell this doesn't use Maven or Gradle or any other dependency management tool, and as I have no idea what I'm doing with Java projects I'm not going to start trying to understand that now.
I'm trying to add the Amazon AWS SDK to my project so I can upload some files to an S3 bucket. I've downloaded the SDK from the AWS site, and extracted the jar files into the lib folder of my project root. I've tried numerous ways of adding these as dependencies, right click the jar files and add as library, go into settings, modules, dependencies, click the plus and add the jars etc. When I build the project it builds fine, and intellisense if picking up the classes and methods when writing the code to utilise the SDK.
However, as soon as I run the app, I get a "java.lang.NoClassDefFound" for the com/amazonaws/AmazonServiceException package as the containing class is instantiated.
This could well be something to do with the "CLASSPATH" that I hear so much about (but don't fully understand), but my understanding was that IntelliJ handled this when adding the jars as a dependency. I've also tried adding all the jars from the "third-party" directory from the downloaded AWS zip file, and adding those as dependencies as well, but it still doesn't want to work.
Incidentally, I'm adding the jars to the lib folder so they are included in source control.
Any suggestions on how to use the AWS SDK without using Maven or Gradle?
Cheers
What I've done is to manually add all the jar files into the External Libraries.
Go to File > Project Structure
In the left window pane, choose Modules under Project Settings
Click on the Dependencies tab
Click on the + sign and select 1 JARs or Directories
Navigate to the folders containing the jar files (include third-party dependecies also) and click OK
See My IntelliJ screenshot

How to include maven built library into your project in eclipse?

I am a novice and don't have much idea. So I have a library that is built with Maven and I want to include this library in my java project in Eclipse, how do I do this? I am using Eclipse juno on MacOSx. I want to run one of the modules in this library, so the source code is provided for this module but how do i run this?
If you are not using maven, you have to download the jar and the sources of that jar (In your case, you can download the zip file provided on the website you mention : http://code.google.com/p/cleartk/downloads/list ) and put it somewhere on your computer.
Then you have to set the build path of your project in Eclipse :
Right-click on your project -> Properties -> Java Build Path
Then you can click on the Libraries tab and Add External Jars so you can point to the jar you downloaded.
In this tab, you can attach the sources of this jar to have access to the source code in Eclipse (and eventually set breakpoint).

how to export java project with external jars already included

I have created a java project using eclipse and in that project I have included a few jar files such as sqljdbc4.jar, jtds-1.2.4.jar, and log4j-1.2.17.jar. I have also included a dll for windows authentication in this project. I'm attempting to export this project as either a .zip .tar etc so the project can later be imported by someone else and work with the project.
I want to export the file in a way that the other developer can import the project and instantly begin working without having to download the jar files that the project is dependent on. Is this possible at all
I have already tried what i have thought would have worked going to export -> Archive file -> save in .zip format. I was unsuccessful with this I also figured going to properties -> Order and Export tab and selecting the needed jars would work and then exporting still unsuccessful.
Once the other developer imports the project the jars are not there for him...
I would use Ant. It is integrated right into eclipse and takes an .xml file called build.xml. It works by specifying "targets" in the xml file that each perform some action such as "build" (i.e. run javac), "deploy" (i.e. run the jar command), etc. There is a command that can be called from within the jar target called zipgroupfileset which you can use to package all of the jars within your main jar file.
More info about ant can be found here
There are many variations on the following but the basic idea is to
use a code library and share the project. The repository
can be local to you or even better put it on an http server
( ala VisualSVN or google or the like ).
1st (local) solution:
Install SVN ( http://subversion.apache.org/ )
Install SubVersion
Create a repo on your local file system
Share the project
Dump the repo
Send the repo
Load the repo (Other developer)
2nd (network) solution (using google code as your library)
Install SVN ( http://subversion.apache.org/ )
Install SubVersion
Put your project on GoogleCode (http://code.google.com/)
Other developer gets project

JSON libs for Eclipse

I am trying to connect to a OpenShift PHP database that I already set up. I am trying to connect to it using a eclipse java class. I tried to use Google Http client files but I am not sure how to add these into my project. I tried adding in via a libs folder but it always shows a error. Can anyone guide me on this?
You need to add the library to your classpath in your project project properties.
Project > Properties > Java Build Path > Libraries
Put the jar in your libs folder and add a jar in the libraries settings. If you only get the source, then you have to add the source package to your source folder and everything should be fine. Alternatively you can link the source in externally. However, you should be getting the library as a jar so just throw that in the libs folder and add it in your project properties.

Eclipse IDE- Add jar? Add External jar? Add Library?

I want to integrate TwitterAPIME to my Blackberry project. I have 3 Jar files provided by TwitterAPIME. I am not sure how to link these 3 Jar files to my project.
My basic doubts are
What is an External Jar ? What is a Library ?
What's the difference between Adding jar, Adding External jar or Adding Library ?
What is an External JAR?
External as the name suggest is a Jar file that is not built by the currently developing code. It is a utility Jar file that is added externally for extra features. It could be an API Jar file provided from the external site, just as in your case the 3 Jar files will be going to call External Jar Files.
To add an External Jar file in Eclipse, follow these steps: Right Click on Project -> Select Build Path -> Select Configure Build Path -> Library Tab in the following Dialog box.
What is a Library?
A Library is a in-built Jar file from the JDK Directory or any other software e.g. J2ME-Polish as you can see in the Image above. Normally these Library files are developed by a manufacturer.
What's the difference between adding JAR, Adding External JAR, and Adding Library?
Adding Jar File: When you have more than one project in Eclipse and you add another project's Jar file, that is called adding Jar File. There is a first Button in the Photo above, it only allows you to add Jar file from the other Project.
Adding External Jar: When you add any API Jar file provided by the site or another manufacturer. In your case the 3 Jar files are External Jar Files. You can add then by using second Button "Add External JARs".
Adding A Library: Clicking on the 4th Button will open a dialog box as below.
You can add different libraries installed on your system. You can also add your own Library, by selecting "User Library".
JAR: A JAR File in your workspace.
External JAR: A JAR File in your file system. Use it for test purposes only, otherwise your project would be quite untidy.
Library: Built-in libraries such as JUnit. You don't need to know their location, these come with Eclipse.
In addition to the excellent answer given above by Lucifer, I recommend that people looking to develop or use Libraries, review the following BB supplied KB article:
Working with Libraries - shared, bundled, releasing, and using 3rd Party SDKs
Where the API is available as source or a Jar, I have found it significantly easier to include the source directly in the application. For example, in this case, rather than include the TwitterAPIME jar, you could include the TwitterAPIME source as a separate project in the application. As well as being easier to build, this can help in debugging or at least understanding issues with the API.
You might also find this sample, and in fact the containing Thread, useful:
Twitter + Facebook Sample Integration
Also building on Lucifer's answer, I have used "User Libraries" to bundle jars that are used across projects and dependent on a 3rd party service. Specifically, in my case, JMS jars. If I upgrade to a new JMS, or a different provider, etc, I can simply change the jars in my User Library and all projects referencing this are updated. Rather than changing jar dependency in every project.
An external Jar is a Jar in a path outh of your Eclipse environment: i.e. outside of both Eclipse jars and projects generated jars.
A libraray is a collection of jars prepared by someone for you.
You can cerate a User Library by selecting a group of external jars: that is useful if you have a group o jars that should logically work togehter.
A further advantage of creating a library is that you can "reuse it's definition" by referencing it in multiple projects.
Use:
Project->Properties->Add library-> select "User library" and press Next->User libraries->New
insert a new name and later us "Add Jar" that adds any jar you need to you library definition.
Later use this library in your project.
Sometimes adding jars directly in the blackberry project might cause some build problems. Here 's a solution that works (90%):
You have your blackberry project. Now create a new simple Java Project.
Right-click on it > Properties > Java Build Path and choose Libraries tab and click on Add External Jars to add the 3 jars that are in your system and you want to use. Then OK.
Now go back to your blackberry project and Right-click on it > Properties > Java Build Path and click on the Projects tab, click on Add and select the project you just created and OK.
Now go back and build your Blackberry project.
I hope this help.
If you add the JAR within the Eclipse workspace, say /myproject/WebRoot/WEB-INF/lib but Eclipse does not display the /lib when using the Select Jar pop-up, exit the wizard and refresh WebRoot (rtClick and take Refresh or F5): Eclipse only shows new libraries not already added to the project and usually needs a manual refresh first.

Categories

Resources