I have a old HP computer and it does not have a connection to the Internet.
How can I get Minecraft installed on this machine via a Flash drive?
Yes, you can. If you can get this done at a friend's PC, you can play Minecraft, without any Java installed on your PC, and without internet as well.
The answer to this may not be entirely simple. Some of the users have indicated that your own PC should not have Java, that is not the case. You can do it with virtually any PC.
Comment below, if something did not work out, as this is a foolproof and a sure-shot method.
If you are using the new Minecraft installer and don't have any form of Java installed on that computer, then it is not possible. The reason is because the new launcher downloads its own JRE, and if you can't connect to the internet to download the JRE then you won't be able to play. However, if you do happen to already have Java installed on that computer, then it should work fine.
If neither options stated above work you can either,
A.) Put a Java installation on your flash drive and install it on your computer or
B.) Place your computer by your router and hook up an Ethernet cable.
Another option is to use a wireless USB network adapter, then you'll have wireless internet. $10 on Amazon, search "wireless USB network adapter"