Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Thursday, March 21, 2013

Creating an Ubuntu VMware player virtual machine for Java Development

Four major steps:

  1. Install Ubuntu
  2. Install Java
  3. Instal Maven (ugh)
  4. Install git
  5. Install Eclipse
Ok, let's get to it.

Ubuntu

Create a new VM in VMWare Player and choose the iso file you downloaded from Ubuntu.  
Set memory to 2gb or you'll live in a world of pain.

Now setup VMWare tools, which won't install correctly until you follow this:
http://askubuntu.com/questions/131351/how-to-install-vmware-tools

Basically, type
sudo apt-get install build-essential linux-headers-$(uname -r)

Then install vmware tools by typing
vmware-config-tools.pl

Accept all the defaults.

Java

Installing Java is well documented as the answer at this URL:

Maven

Maven is the philosophical opposite of Ubuntu so installing it feels a bit like taking a dump on an altar, but many Java projects use it anyway.  Luckily, the install is the least painful thing about Maven (well, as long as you're not using Windows).
sudo apt-get install maven

git

Just follow the bitbucket instructions.  Easy.

Eclipse

Installing the base Eclipse is easy except for the icon.  I won't get into all the plugins you actually need to do work and the hell which can come out of that...
Download Eclipse here.
Open a terminal (click the Ubuntu logo in the upper left and type term and then click the terminal application that appears)
cd ~/Downloads
tar -xvf eclipsefilenamegoeshere.tar.gz
./eclipse &

Eclipse will now launch and a blank icon will appear in the launcher.  If you'd like to fix this, follow these instructions.


Wednesday, July 09, 2008

Eclipse, Exporting WAR files, and JARs

I have a common project that contains JAR files. To add these jar files to a new project, I had to do the following:
  1. Right click on the new project, select properties, and Java Build Path
  2. Click the Libraries tab and use the "Add Jar" button to add the JARs to the project - this removes NoClassDefFound errors
  3. Click the Export tab, and check each new jar file
  4. Select J2EE module dependencies in the left hand pane, and check each new jar file - this includes the jars when the project is exported
  5. Hit OK
  6. Right click on the project, export, and choose WAR file

Wednesday, April 23, 2008

Javadoc Comments and Eclipse

Javadoc allows developers to automatically generate documentation for their code. All you need to do to use Javadoc is include comments before your functions that fit the javadoc format. Then you can use Eclipse to automatically generate the documentation for your project's code. The output has a list of classes and descriptions of parameters, returns, methods, etc. Here's how.

Comment Format

Put comments in the following format before functions:

/** Your comments go here (the javadoc gets wacky if you put them elsewhere)
@param [comma delimited list of params here, case must match!]
@return [non-void type]
*/

Note the use of /** instead of the usual /* to start the comment.

If you want a line break in the generated html, you must use a br tag.

Eclipse

Now to generate the javadoc, click on the root level of your project in the Project Explorer, go to Eclipse's Project menu and choose Generate Javadoc

Eclipse will require a "javadoc command." Actually, this is just the path to javadoc. Javadoc is in the bin directory of the sdk install of java. So just paste in the path to javadoc.exe and you are good to go. Hit finish and you'll have documentation dumped into a /doc folder in your project.

A step by step tutorial is available here.

Labels

Blog Archive

Contributors