Java – Download and Install JDK on Windows 10

Step 1:
You can visit Oracle Help Center for Installation of the JDK and the JRE on Microsoft Windows Platforms and to download JDK visit download page. Click on the version you want for your system, it will ask for Terms and Conditions approval, once confirmed it will start downloading files.
I have downloaded “jdk-15_windows-x64_bin.exe” then installed it in my system.

Step 2:
To install JDK, open the download folder of your windows 10 system. Double click on the executable file (in my case “jdk-15_windows-x64_bin.exe“). Windows will ask for permission to allow installation in the system, once allowed (by clicking Yes), the system will process further. Follow the steps during installation process as shown below in images:

Step 3:
After the installation is complete, delete the downloaded file to recover the disk space. (Optional)

Step 4:
You can verify your JDK installation by visiting your installation path of JDK. In my case it is “C:\Program Files\Java\jdk-15“.

Step 5:
Setting the PATH Environment Variable, so that Java is accessible globally in the system.

To set the PATH variable permanently, add the full path of the “C:\Program Files\Java\jdk-15\bin” directory to the PATH variable.

  1. Select Control Panel and then System.
  2. Click Advanced and then Environment Variables.
  3. Add the location of the bin folder of the JDK installation to the PATH variable in System Variables, as a new line entry.
  4. Click OK for “Edit environment variable window”
  5. then click OK for “Environment Variables window”
  6. then click OK for “System Properties window”
  7. and close the System Control Panel.

Java – “Hello World” program

Step 1:
We will create our first Java file, which can be done in any text editor (e.g. Notepad++, Atom, or Sublime Text).

Step 2: Below is the content of Hello World program file, all lines are required:

public class MyClass { public static void main(String[] args) { System.out.println(“Hello World”); } }

See Explanation of above program

Step 3:
Save the file as “MyClass.java” because our program name is MyClass. File name must be the same as the main function name.

Step 4:
Open a terminal (cmd, putty, git-bash), navigate to the directory where you saved your file.

Step 5:
Type following command in command line, to compile the code:

javac MyClass.java

In case if there is any syntax or code error, the command prompt will point it.

Step 6:
You will find an executable file “MyClass.class” in the directory where you saved your java program file.

Step 7:
Type following command in command line, to run the file:

java MyClass

It will show you the result of the file. In our case it is printing:
Hello World


Congratulations

Java – Explaination of Hello World program

public static void main(String[] args) { System.out.println(“Hello World”); }

Public:
Type: Access modifier
Description: In the above program using public makes main() method globally available.
Public method specifies from where and who can access the method. Public methods can be invoked by JVM (Java Virtual Machine) from outside of the class, in the same program file or any other java program file.

See Java Access Modifiers or Access Controls

Static:
Type: Keyword
Description: JVM invokes static main() method without instantiating the class which, also, in turn saves the unnecessary wastage of memory while calling object(s) declared for calling the main() method.

Void:
Type: Keyword
Return Type: Void
Description: Void is used to specify that a method doesn’t return anything.

main:
Type: Identifier
Description: JVM looks for main() as the starting point of the java program.

String[] args:
Type: Array of type java.lang.String class
Description: It stores Java command line arguments.

System:
Type: Class
Description: System is a final class in the java.lang package

out:
Type: Variable
Description: Out is a public and static member of the System class and is an instance of java.io.PrintStream

println:
Type: Method
Description: The println is a method of java.io.PrintStream, which prints any argument passed while adding a new line to the output.

How to upgrade PHP version in XAMPP on Windows 10

Step 1: Install the Visual C++ Redistributable for Visual Studio 2015 from http://www.microsoft.com/en-us/download/details.aspx?id=48145 if not installed.

Step 2: Download preferred version of PHP for Windows from https://windows.php.net/download/
if preferred version not found in main download page then check past release page https://windows.php.net/downloads/releases/archives/

Here I am upgrading PHP 7 version:
chose version (7**) Non-thread-safe 32/64-bit
I am downloading the “php-7.3.21-nts-Win32-VC15-x64.zip” version as per my need.

Step 3: Once downloaded. Expand the zip file into the path C:\YOUR-XAMPP-FOLDER\php7**

Step 4: In the C:\YOUR-XAMPP-FOLDER\php7** folder, rename the file php.ini-development to php.ini, it may ask for administrator access, allow it.

Step 5: Edit the php.ini file in a text editor (e.g. Notepad++, Atom, or Sublime Text).

Step 6: Change the following settings in the file and save the file:
Change memory_limit from 128M to 2G (because Composer can use lots of memory!) (For Magento reference)

Step 7: Uncomment the line that reads ; extension_dir = "ext"

Step 8: In the section where you find a bunch of extension= lines, uncomment the following required (For Magento reference) lines:
extension=php_gd.dll
extension=php_curl.dll
extension=php_mbstring.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_bcmath.dll
extension=php_ctype.dll
extension=php_dom.dll
extension=php_hash.dll
extension=php_iconv.dll
extension=php_intl.dll
extension=php_simplexml.dll
extension=php_soap.dll
extension=php_xsl.dll
extension=php_zip.dll

Step 9: Add C:\YOUR-XAMPP-FOLDER\php7** to your Windows system path, so that this version of PHP is available globally:
Open the System Control Panel.
Click ‘Advanced System Settings’.
Click the ‘Environment Variables…’ button.
Click on the Path row under ‘System variables’, and click ‘Edit…’
Click ‘New’ and add the row C:\YOUR-XAMPP-FOLDER\php7**
or
Edit existing one and set entry from existing C:\YOUR-XAMPP-FOLDER\php7** to new C:\YOUR-XAMPP-FOLDER\php7**

Step 10: restart XAMPP.

check the PHP version using “php -v”.


Congratulations

Hopefully it will help someone. If you have any questions, please comment out.

Magento 2 – issue with getting “version” number in static files path

Many people advised to DISABLE “Sign Static Files” from Admin Panel.

or to add the value directly in core_config_data table:

or to update the value directly in core_config_data table:

In my case, static file version number was not added in file URLs (in both development and production mode) (in different websites).

As we know, in production mode we don’t get DEVELOPER tab in Admin Panel ( Admin Panel > Stores > Configuration > Advanced > Developer).

What worked for me is, I tried removing ‘dev/static/sign’ record from core_config_data table:

Then I compiled code again, refreshed cache and all okay now.

Bootstrap Form – Floating Labels and Progress Bar

Bootstrap Form: Textarea with progress bar and floating labels

Full code can be found here: GIT HUB LINK

HTML

CSS

NOTE: Bootstrap v4.1 is used for this form.

Feel free to download, edit/modify and use this code snippet.

Bootstrap version 4.1 doc can be found from here: https://getbootstrap.com/docs/4.1/getting-started/introduction/

How To Install Magento 2.3.1 on Localhost using XAMPP

Here we are going to see Magento 2.3.1 installation on localhost using XAMPP software on Windows 10.


Tutorial References:

Prerequisites:

Before we start installation, we need to have these things ready on hand:

  • XAMPP Server installed in our computer.
  • Magento 2.3.1 Application Setup. Magento Open Source can be find from here
  • Composer

Magento 2.3 Application requirements:

  • Web server: Apache v2.2 or v2.4 or nginx 1.x
  • PHP: ~7.1.3 or ~7.2.0
  • Database: MySQL v5.6, v5.7
  • Required PHP extensions:

Open your XAMPP server and start Apache and MySQL applications


Note: Composer is required for developers who wish to contribute to the Magento 2 codebase or anyone who wishes to develop Magento extensions and extend Magento project. Composer enables us to manage the Magento system, extensions, its dependencies, and also allows us to declare libraries for the project.

Learn: How to install Composer?

Note: Once composer is installed, we have to enable the extension (php_intl.dll) in our php.ini (php configuration) file.
To enable the extension, open php.ini file (default path: C:\xampp\php\php.ini) and uncomment the line “extension=php_intl.dll” by just removing semicolon “;” from the starting of the line and restart XAMPP control panel (by clicking on stop and start button in “Actions” column).


Now, we will create a new folder in c: -> xampp -> htdocs folder (default path: C:\xampp\htdocs) (we have used folder name “mage”). Now go inside “mage” folder and extract Magento 2.3.1 files (which we have downloaded earlier from here) inside this folder.


Note: Magento 2.3 allows us to install the Magento software and extensions using either the Web Setup Wizard or the command line.


First, we have to create an empty database in our local phpmyadmin.
Open any browser and go to http://localhost/phpmyadmin/
Then create a new Database.
or we can create using following SQL:

where “mage” is database name.


Way 1:
Here we are going to use “Web Setup Wizard”.

To install the Magento software using the Setup Wizard:

Step 1: Start a web browser.

Step 2: Enter the following URL in the browser’s address or location bar:

It will show you following screen:

Step 3: Now click on “Agree and Setup Magento” button.


Step 4: click on “Start Readiness Check” button.

NOTE: If configuration (PHP extension settins) is setup correct, then we will find following screen:

Otherwise we have to setup configuration properly again.

Step 5: Now click on “Next” button.

Step 6: Enter host, database-username, database-password, database-name, table-prefix (optional):

Now click on “Next” button.

Step 7: Enter web url for magento project (by default magento setup base url for us), we can choose some advance options also, as visible in below screen:

Now click on “Next” button.

Step 8: Now select store default Timezone, default Currency, default Language:

NOTE: We can select and deselect any 3rd party modules from “Advanced Modules Configurations”.

Now click on “Next” button.

Step 9: Now enter admin user’s info like username, email, password and confirm password:

Now click on “Next” button.

Step 10: If all goes correct, then we can find Install button:

Now click on “Install Now” button.

Success: If installation is successful, then Magento will show us following success screen, with encryption key and other details of our Magento project:


Way 2:
Here we are going to use “Command Line”.

Note: Hold the Shift key and right click, and Select “Open PowerShell window here”. This will open PowerShell window on the location.
Note: We can also use Windows Command Prompt or GIT Bash (if installed). Open GIT Bash or Windows Command Prompt and change location to folder (C:\xampp\htdocs\magento), where “magento” is our Magento project folder name.

to understand above commands, please visit this link.

If installation goes fine, we can find above success result in our Windows Command Prompt or GIT Bash window.


Congratulations

Magento 2.3.1 is successfully installed on our localhost.
We can access localhost magento project using http://localhost/mage/ url in any web browser.