Why can I not add .jar to eclipse git repo?
I am using Eclipse Kepler for Java. Normally you can add internal/external .jars to a Java project in the build path located in the properties. Why, when I clone a git repo and import it into my projects, do I lose that ability? I don’t understand. I kinda need to do that.
- Class cast exceptions with ant/jenkins generated EAR on WebSphere 6.1
- Branch vs Tag.. Coming from SVN world
- Should I commit files that are changed by eclipse
- How do you handle different Java IDEs and svn?
- Using readClassDescriptor() and maybe resolveClass() to permit Serialization versioning
- Compile Jython3 sources on Windows
2 Solutions collect form web for “Why can I not add .jar to eclipse git repo?”
This is probably because the
.gitignore has been configured to ignore .jar
Open the .gitignore file and remove the line *.jar, you should be able to add it.
As an aside – usually, for Java projects .jar files are not committed to repository (as they are large & it can slow down repository cloning), instead
gradle is used to configure dependencies. Example – http://www.mkyong.com/maven/how-to-create-a-java-project-with-maven/
Then when you want to work with eclipse just run
mvn eclipse:eclipse to generate the necessary files.
.gitgnore is usually set up to ignore
I found that if you open the run configurations and go to the Classpath tab that you can add internal/external .jars. The run configuration can be accessed by clicking Run > Run configurations. I added my .jar to the user entries. The bootstrap entry caused a null pointer.