I would like to start the program from this repository: https://github.com/SaifurRahmanMohsin/Personal-Diary but when I dowload it and open the project in Eclipse I am not able to build/compile it. So i also can't run it.
Do I have to change run configurations or build a working set or something like that? I usually don't work with Eclipse so I am a bit overwhelmed.
screenshot eclipse1
screenshot eclipse2
Check out. Delete the files .project, .classpath, and folder .settings before you import because those hold data unrelated to your system.
File, Import, Project from existing sources
Pick the inner Personal Diary folder, not the repo folder
You will need to download two libraries to add to the classpath
JSON-Simple and Apache HTTP Client
Related
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
I'm working with huge project which has almost hundred plugins which in turn has it's own folder. The issue is that this project was created in eclipse and for each plugin's source folder a corresponding output folder specified. I'm wondering if it is possible to do the same thing in intellij or I'm forced to use eclipse?
Just some screenshots to make thigs clearer:
In the project structure you can create an artifact for each of your library an specify an output directory.
Try File->Project Structure then in the Project Setting add new artifact and specify output directory
I'm kind of new to Eclipse and I'm hating it so far
The question is I'm working on a small project with some classmates, we are using Eclipse and Git but every time someone does an immport all the libraries are lost because they are referencing the computers path like C:/someone/something.jar and then someone else push something to github and the libraries path C:/someone2/somthing.jar
Every time, I and my partners have to search for the libraries on our pc so the errors stop appearing.
Is there an easier way so we don't have to lose time searching for the libraries on our pc?
You need Java build tool like Maven, Gradle to manage your dependencies.
In that way, it will resolve the libraries for you. And in the source code, you should not check in .classpath,.project meta files. Those files should be added into .gitignore to avoid commit.
To import projects into IDE (Eclipse in your case), Maven and Gradle can help you to generate those IDE meta files. Or some Eclipse plugins could be used to import maven or gradle project.
You should create a folder for libraries and put all jar files in there, add these files to classpath using Java Build Path Option from project properties. Also add this folder to git
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
I am trying to modify the message monitoring plugin in Openfire.
I checked-out the code using svn. And i could also figure out what and where i will need to change the code. But I am not clear about rebuilding the plugin and testing my changes.
In Eclipse, I can export the "plugins.monitoring" package as a .jar, but it does not export all the classes. For example, it exports plugins.monitoring.src.web but ignores classes in sub-packages (if i am not wrong with the term) such as plugins.monitoring.src.java.org.jivesoftware.openfire.reporting.util.
How do I compile only one package and export it to .jar file?
Thanks
I got how to do this. It is to be done using ant
build.xml can be found in the build directory inside the Openfire source code