how install maven on eclipse - java

i want to install maven plug in on eclipse. but when add the maven site in install software section, and beginning to download and install it, an error occurred about dependency. how can fix it?
i want a complete installation guide...

Do these steps:
In Eclipse, go to "Help->Install New Software".
Press "Add" in the upper right button in the opened window.
Set the name textbox to be "Maven2Eclipse".
Set the value textbox to be http://download.eclipse.org/technology/m2e/releases
In case the link is not valid, get one from http://www.eclipse.org/m2e/download/
Press Ok, select the Maven project, and install it.

first which dependencies are missing?
A good maven plugin for eclipse is the eclipse maven sonatype, m2eclipse.

Install Maven Plugin for Eclipse
Installing a Maven Plugin for Eclipse can be a bit tricky if you want to get the whole spectrum of features. By default you would go to “Eclipse -> Help -> Software Updates -> Find and Install”, then “Search for new features to install”, then click on “New Remote Site”, and enter the Maven Projects name (e.g. Maven2Plugin) and its home URL there “http://m2eclipse.codehaus.org/“.
Once you install it at first everything would seem quite right. However, if you try “Import” a Maven Project, you will not see such an option in under the “General” menu, since it would be missing.
The reason for that is that “http://m2eclipse.codehaus.org/” brings in an old version of the plugin. (At the moment of writing) It brings in “Maven 2 Plugin 0.0.9″, whereas what you need is 0.0.12.
Hence you read the “Maven Integration for Eclipse” installation guide and point your “New Remote Site” to “http://m2eclipse.codehaus.org/update/” instead of “http://m2eclipse.codehaus.org/“. The one thing to be cautious about is an “update” link will try to also bring “subclipse” and “mylin” projects, hence you will need to “uncheck” them if you do not want to bring them:
⸺ from https://blog.dotkam.com/2008/02/24/install-maven-plugin-for-eclipse/

Steps to install maven plugin into eclipse:
In eclipse :
go to Help->install new software.
Copy this link http://download.eclipse.org/technology/m2e/releases on "Work With" edit box.
Select enter and maven link will appear on Name section.
Select that link and follow the steps to instal it on eclipse.
You can find more information regarding different maven builds for eclipse here:
http://eclipse.org/m2e/download/

STEPS TO INSTALL MAVEN (in Eclipse):
Maven Eclipse plugin installation step by step:
1. Open Eclipse IDE
Click Help -> Install New Software...
Click Add button at top right corner
At pop up: fill up Name as "M2Eclipse" and Location as "http://download.eclipse.org/technology/m2e/releases"
Now click OK After that installation would be started.
Another way to install Maven plug-in for Eclipse:
1. Open Eclipse
2. Go to Help -> Eclipse Marketplace
3. Search by Maven
4. Click "Install" button at "Maven Integration for Eclipse" section
5. Follow the instruction step by step
After successful installation do the followings in Eclipse:
1. Go to Window --> Preferences
2. Observe, Maven is enlisted at left panel

Related

Codename one/netbeans downloading demos does not work

I have downloaded all the demos of codename one, netbeans. I import the projects. No demo works for me. It shows errors missing jar files, and no main classes. How do i fix this?
See in picture.
showing all errors in downloaded projects
showing specific errors after pressing resolve, .jar missing
Update:
Codename one settings does not work.
I also struggled to get the demos working from the GitHub download, but that is the wrong approach. Shai's answer has already provided the solution, and this post is just expanding on that to clarify the exact steps required in NetBeans.
Step 1 of 3: Install the CodenameOnePlugin plugin:
Tools > Plugins > select the Available Plugins tab.
Select and check CodenameOnePlugin, then click Install.
The plugin will be installed and you will be invited to restart NetBeans, so do that.
Step 2 of 3: Create one of the Demos projects:
Select File > New Project.
After installing the plugin and restarting NetBeans, in the New Project dialog there is a new category named Codename One with a sub-category named Demos.
Select Demos and then select one of the projects from the Projects list such as CameraDemo and complete the New Project wizard:
Open one of the Java source files. You will see that there are no errors for unresolved imports.
Step 3 of 3: Run the demo project you just created.
Select the demo project you chose to create in the Projects tab, then press F6 to run it.
That's all there is to it! No downloading is needed, apart from installing the plugin. However, I did hit a couple of very minor issues:
During project creation some of the projects have the same default name of Demo. Just pick another name.
There is a build problem with certain projects such as Charts:
Unsupported source/binary format (in Charts)
The project source/binary format is older than minimal supported one
(1.6).
The solution is simple:
Select the project in the Projects tab.
Right-click and select Properties.
Select Sources and then update the value of Source/Binary format to 1.8.
I suggest using File -> New -> Codename One -> Demos instead.
Otherwise you need to place the right jars into the projects as they aren't included in git: https://www.codenameone.com/blog/tip-setup-codename-one-demo-from-git.html

Can't find the option to create a new Maven project in IntelliJ IDEA 2016.1

I am trying to create a new Maven project using IntelliJ IDEA 2016.1. I am following the Jetbrains help page for help.
Following step 1, I click on File -> New -> Module, and I'm shown an option dialogue without a Maven option.
I do have Maven installed, and I'm able to use it through the command line.
Turns out I didn't have the Maven plugin enabled.
To enable it I went to File -> Settings... -> Plugins and clicked the check box with Maven. One restart later and it works fine.
File->New->Project..., Maybe you will find out.

How to install Cucumber-JVM on Eclipse

I have searched all over the internet but a newbie on java I cant figure out how to simply install Cucumber-jvm on Eclipse.
What files do I need to download?
I already installed Eclipse. What do I need to do to get Cucumber-JVM on Eclipse?
If you mean the Cucumber plugin for Eclipse you can do this by:
Open Eclipse, Click Help → Install New Software.
Click on the "Add" button at the right side of 'Work with' field.
Give the Name (say, cucumber-eclipse) and input the URL 'https://cucumber.github.io/cucumber-eclipse/update-site' at Location field -> Click OK.
Check the box 'Cucumber Eclipse Plugin'.
Untick 'Contact all update sites during install...'.
Click Next.
Follow the instructions at the prompts.
Cucumber-JVM isn't an Eclipse library or plugin. You can download it in a variety of ways (I find Maven the easiest), and include it in your code.
Why didn't you try this plugin? I think it should be greater for your cucumber coding than the official plugin: BecauseCucumber
Installation steps are there: BecauseCucumber Installation
You can find how to install Cucumber-jvm in the Cucumber documentation
In addition, you'll need the Eclipse plugin.
Steps to Install Cucumber on Eclipse
Open Eclipse
Help > Install New Software > Add
Name: Cucumber
Location: https://cucumber.github.io/cucumber-eclipse/update-site
Then hit Add button
You will see Cucumber Eclipse Plugin. Check the box
Hit Finish button
Then hit Install Anyway
Then hit Restart.

java eclipse red exclamation mark

I have just got a new computer and installed Eclipse Indigo and all of the plugins that I use. But when I open my workspace from my old computer some projects have an exclamation mark.
What does a red exclamation mark mean on a project folder?
The red exclamation mark usually means there is a problem with the Build Path.
Do you see any alerts in the "Problem" View?
It means that there is an error on that project..
You can look at all the errors in the Problems tab. press ALT SHIFT Q followed by X to
show this tab.
It means that there are two things happened.........
What ever jar file or project setup jar file for your application
are not located at that point where it was earlier in your computer.
So that First you have to setup your project with all the jar files
and refresh it.
Check syntax in your project might be some mistake in that.
The red exclamation mark in eclipse is because of the problem/issue with the build path.
To find the specific issue look at the problems tab of the eclipse.
Window -> Show View -> Problems (or) Alt+Shift+Q,X
If you didn't find any error on the project files, usually it means your build path has some issue. First Check your jar file and jar file locations.
On eclispe, right click on your project, Go to build path and go to Configure build path. Check any errors under libraries. Configure it correctly and refresh the project.
It appears mostly because of "build path" only. But just in case you are working on a MAVEN project, here is the solution.
Solution
Step 1. Expand your project in Eclipse > Right click on "JRE System Library" > "Build Path" > "Remove From Build path"
Step 2. Expand your project in Eclipse > Right click on "Maven Dependencies" > "Build Path" > "Remove From Build path"
Step 3. Reach out to your local repository and follow below path "C:\Users\userName\.m2\repository" and delete everything inside repository folder
Step 4. Refresh your project in Eclipse
Step 5. Right Click on your project > "Maven" > "Update Project"
Step 6. Just refresh your project and now we are Ready to GO..
In my case show hidden files was enabled and i had added hidden jar file extensions along with the original jars. Adding only the jar files except the hidden files solved the problem
It can appear when any other file other than .jar is added in the jar library. To fix this, remove the file and clean the project.
If it is maven project and your project view having no error. Then try the following steps
Right click the project ---> maven --> update maven
It works for me.
What the error means is that the Java (JDK) version installed needs an update, as the older version could not be read. To rectify the issue, uninstall your Java (JDK) and install the latest version. Restart eclipse and the would be seen resolved.
This may help in case your build path is correct and you have put the right signature and access specifier for main, so maybe used as a hook to try before you make any modifications to your build path.
Just go to your problems bar and delete the problem given for the project, clean the project and build it. It should solve the problem, if these steps cause the red exclamation to go away.

Maven 2 project error icon in Eclipse

I have create multi-module maven project in Eclipse IDE (already installed M2Eclipse plugin). There I can build my project successfully. But after build also it shows errors icon in my every module project. What kind of issue it can be?
Thank You.
Without knowing what errors you are seeing I am going to assume that your issue is with eclipse project properties (build path, src directory specification, output classes directory, etc).
You tagged m2eclipse plugin, so you should be able to right click on your project in eclipse select maven->update project configuration. If you do not see that option under maven then you should first see an option called maven->enable dependency management. Click that first and then you should be able to see update project configuration option.
If this does not fix it, then open your project directory containing the pom.xml file in command prompt and run mvn eclipse:eclipse.
One of the above should resolve those pesky error messages provided that your maven build itself is successful.
In eclipse open the Markers Tab (You can open it from Window -> Show View -> searching Markers)
It will show all the related errors with your project. You can identify your problems related to your problem, and solve accordingly. Sometimes it shows Quick Fix option, which is helpful.
For me, the above solution listed out by #CoolBeans was not working out, so i searched further and found out the following:
Go to Problems windows(present besides of Console window). If it is not there then click on Window-> Show View -> Problems
Inside Problems you will be able to see the Errors Description related to your project. In my case it was "java compiler level does not match the version of the installed java project facet". If that is the case for you as well, just follow below steps:
Right Click Project -> Properties
Click Project Facets(present in the left hand side list)
Choose the correct java version in Java Project Facet
Click Apply
That's it!

Categories