Unable to add a Junit file in eclispe - eclipse

I have an eclipse java project (screen shots attached). I added Junit libraries to my project and when I say New file, I don't see Junit option.
Once Junit libraries are added, eclipse should be able to show the Junit files. Not sure why it wouldn't

You can install it by the following:
Help -> Install New Software
within Eclipse. In the Work with: field, your Eclipse version should have a Site entry in the dropdown, such as:
http://download.eclipse.org/releases/luna/201406250900
Once you choose this, you can then navigate to:
Programming Languages -> Eclipse Java Development Tools
It should then appear afterwards

Related

Not able to add TestNG library in Eclipse java build path

Not able to add TestNG library in Eclipse java build path. I have installed/uninstalled multiple times but still not able to get TestNG under "Run As". When I look under installed software, it shows TestNG there but no where else it's listed like Add Library and other places. Please help.
I am using Eclipse Neon. TestNG 6.13.0.

Run as Eclipse Application

I am following an Eclipse Modeling Framework tutorial (and also this one). At one of the steps, I need to run a project (the .editor project according to the tutorial) by right clicking on it and selecting Run As -> Eclipse Application. But there is no such item in my eclipse!. I can only see "Java Application" and "Java Applet" in Run sub-menu.
(I am using eclipse-java-kepler-R-win32-x86_64.)
I installed Eclipse Plugin Development Tools (from Help -> Install New Software...) and now, Can run as Eclipse application :)
Running as Eclipse application starts a new instance of Eclipse with the plugin projects installed (the generated projects in my case). So, it takes a lot of memory and can slow down the system. You can export the projects as a plugin for a better performance. you can use lots of available tutorials like this vogella tutorial for Eclipse plug-in development.

Eclipse pom.xml content assistant

I'm new to Eclipse. I'm using Eclipse Kepler to create Maven project, everything works fine except when i'm working with pom.xml the content assistant doesn't give me auto complete just like Netbeans does. Below is the screenshot from Netbeans
My question is can Eclipse be like that in term of gives me auto complete on pom.xml?
Do i need plugin for it?
thank you
There are basically 2 ways for doing that:
Refer to the XML's DTD/XSD in its header, so the simple Eclipse XML editor can help you in a minimal way (e.g., check well-formedness, offers Ctrl+Space assist, etc.).
A better option is to install m2e which is the official Eclipse Maven integration plug-in. It should be available through the Install new software... menu item by default, just search for it. It has quite a heavy support for Maven projects (specific editors, repo browsers, it does update the project configuration automatically, helps you select the dependencies, hanldes multi-module projects, makes easier to import Maven-based projects, etc.)
How to Setup Maven AutoComplete:
1) Download and install the maven plugin into Eclipse. I think the link is this http://www.eclipse.org/m2e/
2) In Eclipse, go to Windows tab -> Preferences
3) Got Maven folder from the left-hand menu. Make sure the three boxes I circled are checked. Click Ok
One of the boxes lets you do AutoComplete. I forget which one.
4) Right-click on your project and go to Maven -> Update Project.
5) You're now done! You should be able to do autocomplete by pressing Control+Spacebar:

How to create, use and run the tutorials from "The Java EE 6 Tutorial" in Eclipse?

The Java EE 6 Tutorial references java ee example projects available through the java ee 6 sdk update tool. The tutorial is oriented towards users of NetBeans and not Eclipse, but NetBeans is not an option for me.
I am new to Java EE and don't know how to take these samples and make an eclipse project from them.
The reason I don't just create a project and copy in the source is that I don't know which eclipse template or project structure I should use for each sample.
So, what should I do with these sample projects to get them up and running in Eclipse?
Thanks in advance.
Assuming you have all the required software to run the Java EE tutorial:
Install latest Eclipse IDE for Java EE developers.
Install Maven Integration for Eclipse (M2E) plugin from the Eclipse Marketplace (Main Menu: Help -> Eclipse Marketplace).
Install Subclipse plugin from the Eclipse Marketplace.
Install Glassfish tools plugin for your Eclipse version. Eg: Glassfish tools for Luna.
Add Glassfish server to Eclipse.
Get the Java EE Tutorial code using the Glassfish Update Tool. In my case, the Glassfish Update Tool did not bring all the codes from the example, so I checked out the Java EE tutorial code from the SVN. (File -> Import -> SVN -> Checkout Project from SVN). Create a new repository location specifying the URL. Example URL: https://svn.java.net/svn/javatutorial~svn/trunk/example.
Ones you have the examples imported to an Eclipse workspace, you can build an individual example projects as follows:
From the Eclipse project explorer window select the project folder you want to build. Example: examples/web/jsf/hello1
Right click on the project folder and select import -> Maven -> Existing Maven projects option. Tick the option to add the project to your workspace.
From the project explorer window, now select the newly added project folder.
Now build the project using option Project -> Build project option.
After the successful build, run the application using Run -> Run As -> Run on Server option.
This worked for me. I had exactly the same question and being new to everything Eclipse, I had trouble figuring this out.
From the link you provided there is a Required Software section. Basically you would need to follow all those instructions except for where NetBeans IDE is concerned.
For Eclipse related configuration I would recommend the Eclipse (Helios) online documentation. Indigo is the latest version of Eclipse but not all plugins support that version.
There is a section in the documention for creating enterprise applications:
Creating an enterprise application project
After familiarising yourself with how enterprise projects are created within Eclipse you should be able to import the sample source applications used in the Java EE tutorial without too much hassle.
You would probably want to install the GlassFish plugin for Eclipse as well.

I don't have "Dynamic Web Project" option in Eclipse new Project wizard

I have download the Eclipse IDE for Java developer, HELIOS. I click 'File -> New -> Project...', but I only have "General, CVS, Java project, Examples". I would like to be able to create "dynamic web project", why do I not have this option?
I searched from internet, and the reason is probably I don't have Eclipse Web Development Tools, but how can I get it?
-----------EDIT-----------
I know by install Eclipse IDE for Java EE developer can solve the problem. But, I am working under Linux Ubuntu, how to get Eclipse Java EE version for Ubuntu Linux machine?
Not all of them are required (I think), but after installing the components listed below I got the "Dynamic Web Project" template added to my Eclipse (Indigo). The list is:
Eclipse Java EE Developer Tools
Eclipse Java Web Developer Tools
Eclipse Web Developer Tools
Eclipse XML Editors and Tools
You can install those packages by clicking on "Help" > "Install New Software", selecting the repository that corresponds to your Eclipse build (i.e http://download.eclipse.org/releases/indigo for Indigo). The packages are grouped under "Web, XML, Java EE and OSGi Enterprise Development".
I think you need the Web Tools Platform package for this. Not very sure though. You can add it to your current eclipse through Help > install new software.
Then add the software repository site location for WTP for your version of eclipse. This is how you can install plugins in eclipse.
"http://download.eclipse.org/releases/kepler"(If you have Eclipse Kepler)
Based on your eclipse choose above link and copy in
help>Install new software
paste in "work with" click add
give any name you want - plugin
In the list select>"Web, XML, Java EE and OSGi Enterprise Development">Eclipse Java EE
Developer Tools. select and install it.
After restart you will have your Dyanmic web project option.
Thank You.
Like me if it worked please
You only need to install
Eclipse Java EE Developer Tools
and you will be able to see "Dynamic web project" wizard.
Download Eclipse IDE for Java EE Developers, everything you need should be included inside. This is the most painless way of obtaining Web Development Tools.
If you want to leave your existing Eclipse IDE, you can go to 'Help -> Install New Software' and find WDT to install them, although I haven't personally tried to go this route, so I can't guarantee everything will work out of the box.
Edit: not sure if it's included in Ubuntu's repository. One other way to do it is to download Linux 32-bit (or 64-bit, depending on your machine) version of Eclipse EE, but you'll have to check if it's the source you have to compile yourself, or an already compiled binary.
Fwiw, I downloaded the standard Java EE version of the Mars version of Eclipse, and ran into the same deal -- didn't see a Web option if I tried File >>> New >>> Project wizard.
The good news: Probably no extra installation needed.
It looks like what I wanted was to select the Other option rather than the Project item (strangely this is what comes up when you hit Ctrl-N, but that also lets us know we're probably on the right track):
After you select "Other", you'll see the "Select a wizard" screen, where you can select "Dynamic Web Project" and profit.
HELP
Install New Software
In Work With input box paste this url: http://download.eclipse.org/releases/{version}/
Replace version with your eclipse's version (eg: LUNA)
Hit enter
Underneath box will have different options, select package of your need.
Maybe Eclipse WTP plugin has been accidently removed. Have you tried re-installing WTP using this location ? If I were you I would have reinstall Eclipse from strach or even better try Spring ToolSuite which integrates with Google Plugin for Eclipse seamlessly (usign Extenstions tab on STS Dashboard)
Just download any eclipse with "EE" letters
I had a similar problem, you may find that going to the top right corner of your page in Eclipse and click "Java EE" instead of "Java" will solve your problem. I had EE installed correctly like you, and this solved the issue for me. Hope I helped :)
Go to Eclipse --> Help
and click--->Install new software
then you can see a window ...There a click add
Then put below url in url box: http://download.eclipse.org/webtools/repository/juno/
i am having juno
if u have any other means put that name .
then click ok.
Make sure to check dynamic web app in "other section" i.e File>New>Other>Web or type in "dynamic web app" in your wizard filter. If dynamic web app is not there then follow following steps:
On Eclipse Menu Select HELP > INSTALL NEW SOFTWARE
In work with test box simply type in your eclipse version, which is oxygen in my case
Once you type in yur version something like this "Oxygen - http://download.eclipse.org/releases/oxygen"will be recommended to you in drop down
If you do not get any recommendation then simply copy " http://download.eclipse.org/releases/your-version" and paste it. Make sure to edit your-version.
After you Enter the address and press enter bunch of new softwares will be listed just ubderneath work with text box.
Scroll, find and Expand WEB, XML, Java EE .... tab
Select only these three options: Eclipse Java EE Developer Tools, Eclipse Java Web Developer Tools,Eclipse Web Developer Tools
Next, next and finish!
The easiest way to handle this is to install the full package installer with all weblogic add ons from the oracle site. This will install eclipse with all the features/plug ins you need.
http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/oepe-network-installer-2371168.html
This helped me find the "Dynamic web project" in Eclipse 2020-12 version. Restart the eclipse and go to file->new->other->web and you will see
project will be available.
This option might be missing because more than one and other than Tomcat runtime is selected. At the marked spot I was shown that I have selected Java JDK runtime. After unselecting it Dynamic Web Module reappeared.