Java Error in Infinite loop?

Hello Everyone, I am new to Java programming and I am attempting to write code that takes the number of sides of a polygon and the length of each side as input and gives the area of the polygon as output. The JRE I am utilizing says that my code won’t run, conceivably as a result of a perpetual circle. I see no errors in my code, yet I have an undeveloped eye so any assistance would be of great value. Below is the code which I am running:

import java.util.Scanner;

public class Exercise04_05{
    public static void main(String[] args) {
        Scanner input = new Scanner(;

        System.out.print("Enter the number of sides: ");
        double num = input.nextInt();

        System.out.println("Enter the side: ");
        double side = input.nextInt();

        double area = (num*side*side) / (4 * Math.tan(Math.PI / num));

        System.out.print("the area of the polygon is: " + area);

Avoid using online tools. Instead try locally installed java.