新建heroku java服务端

 

heroku就是你可以将项目托管至他们的服务器,然后项目会自动部署在他们的服务端并运行。

1.下载eclipse3.7,下载地址是http://www.eclipse.org,我这里有。

2.打开eclipse 安装heroku插件。

 Help > Install new Software

名字随便取,然后location里填https://eclipse-plugin.herokuapp.com/install  然后按步骤就可以安装插件了,然后重启eclipse

3.注册heroku账号.

注册地址https://api.heroku.com/signup。他会先叫你输入邮箱,然后发邮件给你。你点击邮件的链接可以开始注册了(不要用qq邮箱,我用了之后貌似邮件被归为垃圾邮件,没找到。。)

4.新建项目

访问http://java.heroku.com/并登陆

点击create App.就出现了你新建的项目了

我的项目的域名是http://fast-everglades-5516.herokuapp.com

5.导入项目至eclipse.

首先eclipse必须先登录windows->Preferences,选择heroku。输入刚刚在heroku上注册的用户名密码。

然后导入项目右键->import

选择import existing heroku app.

就会出现自己新建过的项目列表

选择自己新建的项目next,然后选择Auto detected project然后finish。项目就导入至eclipse里了

然后就可以自己开发了。

我的服务可以访问http://fast-everglades-5516.herokuapp.com/services/time。就会有返回字段了。

 

 

猜你喜欢

转载自chennaigong.iteye.com/blog/1699659