B4J Tutorial [GCE] For Noobs, Part 1 - Intro

As promised, I present to you a trilogy of short tutorials allowing you to learn some of the basics of Google Compute Platform/Engine (GCP/E). The knowledge you gain from these tutorials will allow you to host a B4J (or any other .jar) console app on a Virtual Machine (VM). By ‘console’ I mean ANY console app including a web app because a web app is simply just another console app. You will also need to have a credit card handy to sign up for the free stuff offered by Google - I know, I know!? It’s free so why do you need to provide credit card details?? Well, I’ve got nothing helpful to add there.

Disclaimer: Before we continue I just want to say that I am not an expert! I have had to learn this stuff the hard way and yes, I’ve made plenty of noob mistakes along the way. I’ll do my best to help steer you through the cloud and come to terms with some of the technical thingys that get will cross your path. If you follow along EXACTLY as written/stated then you will have a working B4J console app running on a GCE VM.

I have tried to make the tutorials easy to follow along and to read. I’ve read manuals that have given me mental paralysis after a couple of pages and I have tried to avoid that.

I’ll also be showing you how I do things. There are other ways of doing things of course, but I’ll be showing how to do things using the tools that I use. Don’t worry! I’m sure that most of you, reading this, are already using the same tools. Below is a comprehensive and very long list of the tools that I use. Make sure that you have them all installed and ready to follow along. If you need to clear out some space on your hard disk now would be a good time to do it.

List of the tools I use:
  • B4J
  • Google Chrome (the browser)
Phew! But, yes there’s a but, if you want to use something like MySQL then I would add to this list MySQL Workbench CE (https://www.mysql.com/products/workbench/). Using MySQL is outside the scope of this tutorial I will not be covering it. However, I will show you how to install MySQL / MariaDB onto a GCE VM (by the end of these tutorials you’re going to LOVE all these little abbreviations and acronyms :D ).

BTW, in case you’re wondering what a ‘noob’ is, and even if you’re not, a ‘noob’ is someone that is new to something that lesser noobs enjoy having around because it makes them feel less like a noob. :) In other words, a noob is someone new to something. We’re all noobs at everything - it’s a good thing! ;)

Why do I use GCE? I find using GCE easier to use than Amazon Web Services (AWS). GCE’s terminology and naming conventions for most of the services on offer make more sense to me than those used by AWS. I will not be covering AWS in this tutorial or any other tutorial as I just do not grasp the naming conventions used by AWS.

Another reason why I use GCE (or any other Virtual Private Server (VPS) or Virtual Machine (VM)) is that I can use port 80 for my web apps! Yes, you heard right! Port 80! This is something that you just cannot easily do with shared web hosting. VM’s give you a lot of flexibility on the port/s you can use (with some exceptions) and gives you control over the resources the VM can have. By ‘resources’ I’m referring to the number of CPUs and the amount of RAM.

Okay, I’m going to wind this first tutorial up with a look at some of the topics that will be covered in future tutorials. The list is not comprehensive and I’m sure that more tutorials will be added over time and the list below will become out of date.

In following tutorials we’ll cover the following topics (not in any particular order):
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
Please, Please, Please! Link the parts using this post as a starting point! This way we have only to bookmark this thread!
 

Piero Salandin

New Member
Hi there, Ed! AFAIK oe of the best tutorials I've ever seen.
But a question: in Part 8 you are rfeferring to a file named GCEDemo.jar; wher does it come from?
Thank you very much!
 

Ed Brown

Active Member
Licensed User
Longtime User
Hi there, Ed! AFAIK oe of the best tutorials I've ever seen.
But a question: in Part 8 you are rfeferring to a file named GCEDemo.jar; wher does it come from?
Hi @Piero Salandin,

Thanks for the kind words :)

The file in question is a very simple sample I put together to show how to use the Buckets. It can be any file.
I have added the sample to the tutorial. It does nothing more than display the time second. ;)
 

Ed Brown

Active Member
Licensed User
Longtime User
What a fantastic series of tutorials! Thank you, I will be trying this very soon. Little sugestion: maybe put up a link in this post to each sub post so we can use this one as the starting point (the posts will get seperated in time by other posts).
Hi @alwaysbusy, thank you for the encouragement and kind words!
I have added the links - great idea!
 

Cableguy

Expert
Licensed User
Longtime User
@Ed Brown I may have missed this, but can you give us an example of how a typical url for a webapp would look like using GCE? If you use a 'normal' VPS, it is the IP address + port + appname. Is this the same using GCE?

Actually, if you use port 80 in your app, and the rootFilter handler, your address will be as simple as "www.mywebapp.com"
just remember to enable both UDP and TCP protocols in the port.
I use this system in my vps
 

Ed Brown

Active Member
Licensed User
Longtime User
I may have missed this, but can you give us an example of how a typical url for a webapp would look like using GCE?
That's a really good point and I can't believe I missed that! I've update Tutorial 9 and added more details on what to look for and how to do it.

Actually, if you use port 80 in your app, and the rootFilter handler, your address will be as simple as "www.mywebapp.com"
just remember to enable both UDP and TCP protocols in the port.
That's spot on! There'll be a separate tutorial covering the use of domain names and Content Delivery Networks (CDNs) - it's a more advanced topic.

Thank you both :)
 

yaqoob

Active Member
Licensed User
Longtime User
Thank you Ed. Very nice work and very useful. This what I was looking for.
 
Top