SapHanaTutorial.Com HOME     Learning-Materials Interview-Q&A Certifications Quiz Online-Courses Forum Jobs Trendz FAQs  
     Explore The World of Hana With Us     
About Us
Contact Us
 Apps
X
HANA App
>>>
Hadoop App
>>>
Tutorial App on SAP HANA
This app is an All-In-One package to provide everything to HANA Lovers.

It contains
1. Courses on SAP HANA - Basics, Modeling and Administration
2. Multiple Quizzes on Overview, Modelling, Architeture, and Administration
3. Most popular articles on SAP HANA
4. Series of Interview questions to brushup your HANA skills
Tutorial App on Hadoop
This app is an All-In-One package to provide everything to Hadoop Lovers.

It contains
1. Courses on Hadoop - Basics and Advanced
2. Multiple Quizzes on Basics, MapReduce and HDFS
3. Most popular articles on Hadoop
4. Series of Interview questions to brushup your skills
Apps
HANA App
Hadoop App
';
Search
Stay Connected
Search Topics
Topic Index
+
-
Cloud Computing Overview
+
-
SAP Cloud Platform
+
-
Internet of Things
+
-
SAP and IoT
+
-
Cloud Foundry

Run your first Java Hello World in Cloud Foundry

In previous article Cloud Foundry - A Game Changer , we gave you basic introduction to Cloud Foundry. We also learnt how to run PHP Hello world program in Cloud Foundry.
In this article, we will explain how to run Java Hello World program in Cloud Foundry.

Scenario:

Pivotal web services (PWS) provides “Cloud Foundry as a web service,” deployed on top of AWS. You’ll just need create an account and you’ll automatically get a sixty day free trial.
Cloud Foundry supports many languages like Java, PHP, Ruby, Node.js etc. In this example we will run Java hello world program in Pivotal Web Service.

Prerequisite:

Register with Pivotal Web Service.

Step 1: Register with Pivotal Web Service

Register with Pivotal Web Service. Create your account and finally you should be able to see your Pivotal account as below.

Cloud Foundry and HANA Cloud Platform

Step 2: Install the Cloud Foundry Command Line Interface (cf CLI)

Cloud Foundry Command Line Interface (cf CLI) is a tool to deploy and manage applications in Cloud Foundry.

  1. Click Tools on the left navigation menu of the Apps Manager to access the Tools page. Install the appropriate cf CLI version for your OS.

Cloud Foundry and HANA Cloud Platform

  1. Add the Cloud Foundry path to environment variable.

Cloud Foundry and HANA Cloud Platform

  1. Open Command Prompt and run “cf help” to confirm that the tool is installed correctly. The example shows the beginning lines of output for this command.

Cloud Foundry and HANA Cloud Platform



Step 3: Download and deploy Java Hello World Application in Cloud Foundry

  1. Download the Java Hello World program from here.
  2. Enter command “cf api api.run.pivotal.io” to set the API endpoint.

Cloud Foundry and HANA Cloud Platform

  1. Enter “cf login” to login. Enter your email id and password you used while registering to Pivotal Web Service.

Cloud Foundry and HANA Cloud Platform

  1. Open Command Prompt and enter the command “CD <CF_FOLDER_PATH>”.

Cloud Foundry and HANA Cloud Platform

  1. Enter the command “cf push” to publish the Hello World application.

Cloud Foundry and HANA Cloud Platform

Note: Apps names are global. Hence you may encounter the following error:
“The host is taken”.
To fix that, please add a suffix or prefix (or change the entire name) to the “host” attribute within the manifest.yml file.
  1. Finally the application should be started and the app URL should be provided as below. For example in this case, it is Java-HelloWorld.cfapps.io

Cloud Foundry and HANA Cloud Platform

  1. Copy the URL (in this case Java-HelloWorld.cfapps.io) and paste it in browser. You will see the application running.

Cloud Foundry and HANA Cloud Platform

  1. You can also check this application running in your Pivotal account.

Cloud Foundry and HANA Cloud Platform


Congratulation! You have successfully run your first Java Hello World in Cloud Foundry.




Support us by sharing this article.



Explore More
Close X
Close X

2 thoughts on “Run your first Java Hello World in Cloud Foundry

  1. Ankes says:

    Very nice and easy to understand!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Current day month ye@r *

 © 2017 : saphanatutorial.com, All rights reserved.  Privacy Policy