Facing errors when trying to add a Java API - java

I am using the eclipse IDE and trying to use a JAVA API.
This is the API I am trying to add. https://github.com/spoonlabs/flacoco
It says that the API is only currently available as a snapshot and gives me the details to add it as a dependency in a pom.xml file.
I am not sure how to do this in eclipse. I have downloaded the M2Eclipse plug in and tried creating a maven project by skipping the archetypes but when I add the dependency I get too many errors.
These are the errors that pop up : https://ibb.co/Y4gNnN8
I do not know to resolve the issue.
If any more details related to the error is needed,please let me know.

You project hierarchy, as well as the pom.xml setups are wrong.
At the pom.xml, change the group id to something like com.<your_name>.<porject name> then create the same package structure under src/main/java (you should end with up with something like src/main/java/com/<your_name>/<porject_name>).
This should fix whatever you're seeing now.

Related

java.lang.module.FindException: Unable to derive module descriptor for cucumber-core-7.3.4.jar

I initially created a plain Java project that followed the steps mentioned here and here but unfortunately, my project didn't work, I am getting this above error. I have not reached the step where it talks about integrating selenium.
Just to mention I used all the latest versions of the jar files as shown below.
I also got other various problems also, and to resolve them when I searched on the internet everyone was talking about the configuration inside the pom.xml file. But this file comes in the Maven project! so I converted my project to a Maven project. But that too didn't resolve my issues so I "disabled the Maven nature". No luck even after that.
currently, it is a Maven project but when I am following this step it is giving me the subject error.
This is how my package explorer look like:-
The trick is to start small with something working. And then after each change check if it still works. This will help you build an understanding of what each component and change does without overwhelming you.
Unfortunately you are following tutorials that do a whole lot at once. Try to break this down a bit. First learn about Maven, with plain Java and maybe a unit test. Then learn about how Eclipse works with Maven projects. Then use Cucumber with Maven, then add Selenium.
This may seem like a lot more work but it is faster because you'll only have to solve one problem at a time.
I don't have any tutorials for Maven or Eclipse but for Cucumber you use:
https://docs.cucumber.io/docs/guides/10-minute-tutorial/

Jcabi Github ExceptionInInitializerError

I am currently working on a Bukkit plugin, and trying to implement to get config files from github. I am trying to use JCabi-Github for this. I got the library implemented and working, but whenever I use it, it creates an error. I tried to use this code:
Github git = new RtGitHub(user, pass);
Which doesn't give any compile-time errors
And following the Javadoc should be just right
But when it runs, it creates a java.lang.ExceptionInInitializerError.
How do I fix this?
Check how you are using your program with JCabi-GitHub.
See issue 1270:
I'm afraid that "compile via eclipse" is what broke the structure of the JAR file.
Try to package with Maven.
The problem is not only "compile via eclipse". There's a bug in the library: it reads some attributes from its Manifest.MF, which may be problematic when you package your app in a .war, for instance.
There is an open ticket to change this mechanism; until then, the best solution is to:
1) use Maven to build and package your app
2) use maven-assembly-plugin to hardcode the needed values into your final artifact's Manifest.MF.
See here: https://github.com/jcabi/jcabi-github/issues/1198#issuecomment-225122003

Info about version dependancies of enterprise java libraries

I am new to enterprise application developement and trying to create a REST server with Spring REST, JPA taking to mySQL database and Javascript on the client side. As I see loads of opensource libraries doing specific task, I started off with using 'maven project' with different 'arch type' (which is nothing but predefined POM with relevent libraries as I understand) provided by Eclipse. But I often run into version mismatch issues, in many cases found specific solution to that perticular libraries in StackOverflow or other sites.
Hence I started looking for a information these version dependancies such as, this version of JPA works with that version of Hibernate library and so on. I checked maven repository of major libraries, I did not find such information so far.
My queries are:
Where can I find these information about the versions dependancies?
Are these pre defined POM in eclipse reliable? Who owns them, where can I get last modified dates on these maven 'arch types'? (I find the ones I choose having fairly old version of libraries).
If I have to start off on my own creating a Maven dependacies, where will I get information about what are the dependent libraries, for example, if I need spring MVC, for sure it needs java servlet library. I am worried becuase the maven 'spring-mvc-jap' arch type whooping 50 libaries as dependancies.(Coming from embeded domain, I find to too hard to digest :D). So not sure if it is the right way.
Please correct if I am missing anything in my understanding.
You can find this information, if you are using maven and some IDE you can go to the dependancy and make click un > and this will show the librarys used for this dependancy or if you want to use the console you have http://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html this will show the same that the IDE.
After normally in the documentation of the library used, you can find some doc about the dependancy about this.
Other solution is get the .jar and use 7zip to see the POM and know the dependancy used.
And for finish my answer if the IDE tell you that you dont have x dependancy normally you have to add this because any of the other dependancy used have it (they used only for the compiling task), but sometime somes projet change a lots of code between the version .a to .b so you will have some problem using the version .b, at this moment i didnt find one good and easy way to fix this, only using the way that i told you (only if i found some problem in the compilation)
3> I am not sure how it works in eclipse but in IntelliJ IDEA when you start using some class without proper dependency IDEA suggest you to add proper dependency automatically. The same approach should be in eclipse.

How i can Run PageTurner project from github?

I am new android developer.I want to run the project of Page Turner(from git-hub project).I can't run this project.Only one error show here.This error are "The type org.htmlcleaner.TagNode cannot be resolved. It is indirectly referenced from required .class files".I also added with this project
1)ActionBarSherlock library project.
2)daisy-htmlcleaner-1.4.1.jar file.
3)epublib-core-latest.jar file.
4)htmlspanner-0.3-SNAPSHOT.jar file.
5) maven-site-1.0-site.jar file.
Please help to me,how i can run this project without this error.
Well, looking at the error message, it seems that you have the wrong version of htmlcleaner.
Are you using Maven to build PageTurner? That should automatically download the correct dependencies for you.
If you're trying to build PageTurner in Eclipse, take a look at the screencast I did: http://www.youtube.com/watch?v=jhSvwpwPFoY

play framework first project on NetBeans not working

I am creating my first project using play framework on NetBeans and I have done all the steps needed to create the project, nebeansify and so on. however the project is created with errors like package models doesn't exsit. so anyone knows if I am doing something wrong, also if anyone can give me useful links, videos.
If it's complaining about the models package being empty, just add a
model to it.
If that doesn't work, try closing the project, doing play netbeansify again and
reopening the project in NetBeans.
If it still doesn't work you can always add the missing dependencies to
the classpath manually (Project Properties -> Java Sources
Classpath). But this might mean you did something wrong while installing Play.

Categories

Resources