Aptana Cloud Connect supports Java Deployment. You can use the standalone version of Aptana Studio to create a Java hosted site and deploy an existing Web Archive (WAR), or you can install Aptana Studio as a plugin into an Eclipse bundle that includes Eclipse Web Tools (WTP) to create and develop Java Web Applications and deploy them via Aptana Cloud Connect.
Contents |
Installing Aptana Studio
To create and develop Java Web Applications in Aptana Studio, Studio must be installed as a plugin over an Eclipse bundle with WTP. The resulting Java web projects can be deployed to Java hosted sites via Aptana Cloud Connect.
- Do one of the following:
- Download and install Eclipse IDE for Java EE Developers from the Eclipse Download Site.
- Add WTP to your existing Eclipse 3.4 install by choosing Help > Software Updates... > Available Software > Ganymede Update Site > Web and Java EE Development, and then selecting Java EE Developer Tools and Web Developer Tools.
- Install Aptana Studio as a Plugin for Eclipse 3.4 from the Aptana Studio Update Site.
The standalone version of Aptana Studio does not support creating and developing Java Web Applications, but it is possible to create a hosted site that supports Java and to deploy an existing WAR file to that site from Aptana Studio.
- Download and install Aptana Studio Standalone from the Aptana Download Site.
Creating a Java project in Aptana Studio
For your convenience we have included in both the standalone and plugin versions of Aptana Studio a Java Sample project with all artifacts needed to deploy via Aptana Cloud Connect. Note, however, that the Java and JSP sources cannot be modified and compiled without WTP. (Do not "clean" this project unless WTP is installed. The compiled classes will be deleted and the deployed application will not work correctly.) For details on how to create a Java Hosted site from this sample project, see below "Create a Java Web Project from a Sample."
To create a Java project in Eclipse with WTP and Aptana Studio installed:
- Right click in the Project view and Select New > Other > Web > Dynamic Web project
- Right click on the Project Node and select New > JSP (or Other > Web > JSP) to create an index.jsp file.
- Add some content between the <body> tags, such as <h1> Hello World </h1>.
- Save the file.
Adding Local Tomcat Server for testing (optional)
- Download and install Tomcat Server from http://tomcat.apache.org/download-60.cgi
- From the project Window Right click and select New > Other > Server > server
- Select Apache > Tomcat 6.0/5.5 and choose the Tomcat installation folder
- Right-click on the project and select Properties > Server.
- Select the newly-added server to add it to the project.
- Test the project locally by right-clicking on the project and selecting Run As > Run on Server. This should start the Tomcat server and show the default page of the application in an embedded browser in the editor.
Creating a Java hosted site
To create a hosted site from a web (non-Java) project:
- Choose Hosting > Create New Site
- In the New Site wizard, select the New Project option, choose Default Web Project from the adjacent drop-down menu, and click Next.
- Enter a project name and click Finish.
- When the My Cloud portal opens, click the green Sign Up button next to the hosting plan of your choice.
- On the Sign Up page, enter or create an Aptana ID, enter a credit card (if necessary), and choose a site name.
- Important: In the "Choose Your Platform" section, select the Java option.
- Click Create my site.
To create a hosted site from a Java sample project:
- Choose Hosting > Create New Site
- In the New Site wizard, select the Sample Project option, choose Java Car Demo from the adjacent drop-down menu, and click Finish.
- When the My Cloud portal opens, click the green Sign Up button next to the hosting plan of your choice.
- On the Sign Up page, enter or create an Aptana ID, enter a credit card (if necessary), and choose a site name.
- Verify that the Java option is selected in the "Choose Your Platform" section.
- Click Create my site.
To create a hosted site from an existing Java project:
- In the Project view, right-click on the Java project folder and choose Deploy to Cloud > Deploy New Site...
- When the My Cloud portal opens, click the green Sign Up button next to the hosting plan of your choice.
- On the Sign Up page, enter or create an Aptana ID, enter a credit card (if necessary), and choose a site name.
- Verify that the Java option is selected in the "Choose Your Platform" section.
- Click Create my site.
Deploying to the Java hosted site
When your new site is ready, it should appear in the My Sites tab of the My Cloud portal. The project can be deployed to either the public (production) site or the staging (test) site.
To deploy your project to your site:
- If My Cloud is not visible, choose Window > My Cloud to show it.
- Select the My Sites tab.
- Select the Overview tab for your site.
- Click Deploy (the blue button in the upper right corner). The Deploy WAR File dialog will appear.
- Select Public or Staging as the target for deployment.
- Choose whether to create a WAR file automatically or to upload a existing WAR file.
Note: If the project associated with the Site is not a Java Web project, then the option to automatically create a WAR file will be disabled. - Click Deploy to upload the WAR file to the site.
Note: As mentioned in the dialog, after the WAR file is uploaded to the hosted site, Tomcat Server might take up to a minute (depending on the size of WAR) to deploy the WAR. If you try to view the site before the WAR is fully deployed you may get a 404 error page from Tomcat Server.
To confirm that your site has deployed successfully:
- In the My Sites tab of the My Cloud portal, select the Overview tab for your site.
- Under the Explore area in your Control Panel, select Public Files or Staging Files (depending on which server you deployed your files to).
- The location of your WAR file will appear in the File View.
- Right-click on the WAR file and choose Properties to confirm the size of the file.
Accessing MySQL from the deployed Java Web application
For details visit Accessing MySQL on a Java Hosted Site
