enter image description hereAdding jar files from the latest version of selenium 3.141.59 show missing after adding them inside the build path of my project.
Windows 10, Eclipse, selenium 3.141.59
the client- combined files shouldn't be missing. previously it worked out.
If you are using the Selenium Java Client in addition to adding client-combined-3.141.59.jar with the build path of your project you also have to add the following jars from the libs sub-directory:
byte-buddy-1.8.15.jar
commons-exec-1.3.jar
guava-25.0-jre.jar
okhttp-3.11.0.jar
okio-1.14.0.jar
Snapshot of libs sub-directory:
Refreshing/Updating as #Rakib mentioned in comments might work.
However, I would suggest having some Build Tools such as Ant, Maven or Gradle in place for Dependency Management. This would automatically resolve and import the required jar files.
The current format of handling jar files would be confined to local and if you try to export the project into a different operating system that would throw an error defining missing jar files.
I have added all the jar files but still showing error for particular client combined jar files. show as corrupted. However I managed to download it from the following link: https://www.seleniumhq.org/download/
enter image description here
Use maven. It is very easy to maintain java projects with it. In case you are missing something, you can easily add dependency, or in case everything is on your project, but not on your local machine, you will just need to refresh your dependencies and maven will do the rest. here is the link: http://maven.apache.org/
Related
I am new to github. I tried to clone a repo and then pull the files on my computer. All the other team members did the same thing and it worked for them. When i open the project with Intellij all the .java files look like this:
files
It also says that my SDK isn't set.
I tried to set my SDK, and also i tried to set the java directory as 'sources root' because someone said that is a problem with the project structure.
These problems disappeared but then IntelliJ didn't recognize that my project is a maven project so i had to add manually the file pom.xml and refresh maven.
Then this problem disappeared but i had another:
"Cannot start compilation: the output path is not specified for module 'cmsiss'.
Specify the output path in Configure Project."
I tried to set it from project structure but now I have this error:output error
Please help.
Open maven project using pom.xml file. File->Open->pom.xml
Sources should be pointed to project root, not java directory.
Give these a try.
The usual steps that I follow to open the project:
git clone <github clone url>
Open the project in intelli J using
File<Open
and browse to open the root of the project.
This should work fine but if it does not, a few more things you can try:
Try making the project root as a maven module
You can open the Project Structure to make sure you have Java SDK set up properly. It should show the java version you are using there.
Worst case, that is if nothing else works and if the project is not too big, just create a new maven project and make sure it runs, then add all the project files.
I pulled the project again and started from zero. I specified the SDK and then I opened the Maven project window and added a maven project (selected the pom.xml file) and refreshed it. Maven did it's job and created the project structure and all the stuff I've tried to do manually and finally worked!
I am newbie to GitHub and I made an open source project.
I have linked my GitHub project with eclipse.
The code is commited, but it is dependent on Selenium jar file (which is not commited/available on GitHub).
In Eclipse I have added Selenium jar in Java Build Path so my code doesn't give compilation errors.
Since I am newbie to GitHub I don't know how to add jar in build path of GitHub(If there is need to do that).
My questions are:
Is jar/libraries need to be added on build path of GitHub for project ? If yes then how to do it ?
How can we check code compilation errors on GitHub ?
For Question : 1
In Github first you have to check the gitignore file of your project
For further reference please go through the following links :
https://git-scm.com/docs/gitignore
https://github.com/github/gitignore/blob/master/Java.gitignore
Please remove .*jar references from the git ignore file
Keep your third party libraries in your Eclipse Project root directory.
In Eclipse build path Click on Add Jars and select the jars from your project root.
This adds a relative classpath for the jars. So even if you switch to a new machine also you don't need worry about classpath issues just git pull and run the tests.
For Question 2
Github can't check Java compilation errors.
Github is a Version Control Management and Collaboration tool.
My goal is to run unit tests in fitnesse.responders.run.slimResponder for testing my DataFlex SlimRunner implementation. So I downloaded the Fitnesse source code, and made it a new Java project in Eclipse. I was able to compile it by selecting Run As Ant Build (2) on the build.xml file. But in order to resolve include errors in the Problems view in Eclipse, I ended up manually adding dozens of external JARs by hand. I found that Maven/Ivy had apparently downloaded the jars as part of the Ant build. But somehow these were not added to the Java Build Path.
It seems reasonable to me to assume that there should be an easier way to set up the Java Build Path than to add the JAR files manually, since build.xml apparently contains all this information already. What am I missing?
The Fitnesse Readme.md mentions using Apache Ivy for dependency management. Download IvyDE from Eclipse Marketplace, and set it up (use the ivy.xml that is part of the Fitnesse source code).
I am quite new to Java and Eclipse.
I am trying to call some functions from the jpf library from a program that I am writing in Eclipse.
Can anyone help me load or install these libraries into my Eclipse project? The .zip files are here. If these are already in the Eclipse program or there is some better way to get them, can someone also post that answer in addition to how to load any arbitrary java library.
Thanks for the help.
The JPF project page, to which you already linked in your question, contains a section about setting up the Eclipse IDE for JPF projects. A more general webpage on how to add external jars to your eclipse project might be helpful as well
download desired jar in to your local machine - add those jar to your project using below
right click on your project - configure build path - libraries - add
external jars - browse downloaded jars - add
Download and extract jpf-bin-1.5.1.zip. In here, you will find one or more JAR files. Add them into your Eclipse project, under something like a "lib" folder. Right-click on the JAR files from there, then choose "Build Path" / "Add to Build Path".
Or better yet, investigate the use of Apache Maven, and let it handle all of the dependency resolution for you. (Per http://jpf.sourceforge.net/roadmap.html, this project is at least Maven-enabled.) At least the 1.5 version is also available from the central Maven repository at http://repo1.maven.org/maven2/net/sf/jpf/jpf/. I don't see 1.5.1, but the jpf-bin-1.5.1.zip contains a "MAVEN.txt" that explains how to install it into a local Maven repository for use.
check how add libraries in eclipse.
http://wiki.eclipse.org/FAQ_How_do_I_add_an_extra_library_to_my_project%27s_classpath%3F
Also check this how make user libraries in Eclipse and then add them in your project.
http://i-proving.com/2006/07/18/user-libraries-in-eclipse
I'm working on a swing project, using maven2 (from command-line) and eclipse (without maven integration). So, I generate the eclipse project through maven eclipse plugin (mvn eclipse:eclipse), import it inside eclipse, and do all my work.
My problem is: when I run my app in eclipse (as a Java Application), I can't find none of the resources that are in my src directory. Digging for information on my problem, I get into this answer from another question. So, I compared the output from the following instructions:
MyClass.class.getResource("/").getPath();
MyClass.class.getProtectionDomain().getCodeSource().getLocation().toString();
Those gave me the following outputs, respectively:
${workspace_loc}/${my_project}/target/test-classes/
file:/${workspace_loc}/${my_project}/target/classes/
Checking the above locations, I could see that the former is empty, while the other one contained all my compiled classes and resources. So, I came to the conclusion that the classloader is looking for my resources in the wrong place. So, I think I have three questions:
Is my understanding correct?
If so, how it does to find the classes it is loading?
How do I solve this?
UPDATE: I've changed my code, so instead of invoking MyClass.class.getResource(...) or MyClass.class.getResourceAsStream(...), I'm now using ClassLoader.getSystemResource(...) and ClassLoader.getSystemResourceAsStream(...). In this way, everything is working fine in eclipse. I just don't know exactly why. Any hint on this?
Two possibles cases for me :
You are using eclipse to compile your project. Then eclipse is configured to exclude (or not include) resources in the src folder. You can set it in Project/Properties/Java Build Path/Source. Then you expend your src folder, and ensure you have something like "Included All", "Excluded None".
You run your maven application using maven to compile and not eclipse, even though you are using eclipse as your IDE. Then by default maven will not copy resources from the source folder to the output folder... Because it is not the standard maven way of doing things. Thus the resource are missing from the classpath and you don't find them. Just change your maven configuration to also include resources from your source folder.
I think you have to add src/main/resources to the build path. This is done in Project Properties > Build Path > Source. Here is how the standard maven project looks:
In future when using Eclipse I suggest to use m2eclipse plugin and create project using it. This will automatically make sure that all these folders are in the build path.
Try this:
Run configurations... -> Classpath -> User Entries -> Advanced... -> Add Folders
Can you try loading the resources using below?
this.getClass().getClassLoader().getResourceAsStream(propertyFileName)
This might be useful information
Eclipse Maven plugin has its own Classpath Container that conflicts with generated class paths when enabled.
What I would suggest is stop using eclipse:eclipse (sorry - harsh I know). I used it for about 8 months, cant believe it took me that long, and used M2Eclipse. M2Eclipse is an eclipse plugin in which you do the following.
Enable Dependency Management.
Update Project Configuration
(In Eclipse) Project -> Build Project
(In Eclipse) Run Application
It may not seem it, but its a much easier and less frustrating way of doing it.
Before, with eclipse:eclipse. You would have to run it then hit refresh and hope that everything is configured - if you have a multi-module pom things can really go wrong.
For me the Files within the WEB-INF were not getting included. Hence I added them to Buildpath (Project -> Build Path -> Configure Build Path -> Add folder (project/src/main/webapp). This resolved the issue.