Deployment guide

Java on Windows

Overview

This guide covers the deployment and use of Java on Windows Server using SecureAnyCloud AMIs from the AWS Marketplace. This AMI provides a preconfigured Windows environment with Java preinstalled, ready for developing and running Java applications.

What's included in this AMI:

  • Java (JDK) preinstalled and configured in the system PATH
  • Command Prompt desktop shortcut for quick access
  • Windows Server with Remote Desktop access
  • 24/7 SecureAnyCloud support with guaranteed 24 hour response SLA

Prerequisites

Before you launch this AMI, make sure that you have:

  • An active AWS account
  • An active subscription to the Java on Windows listing on AWS Marketplace
  • An EC2 key pair for password decryption
  • A Remote Desktop client application

Recommended instance type: t3.medium (2 vCPU, 4 GB RAM) or larger. The minimum requirements are 1 vCPU, 1 GB RAM and 30 GB of disk space.

1

Launch the AMI

Launch the AMI from AWS Marketplace and configure it as follows:

  • Go to AWS Marketplace and search for "Java Windows SecureAnyCloud".
  • Click Continue to Subscribe, accept the terms, and then click Continue to Configuration.
  • Select your preferred Region and Software Version.
  • Click Continue to Launch.
  • Choose Launch through EC2 for full control over instance configuration.
  • Select your instance type (t3.medium recommended).
  • Configure storage with a minimum of 30 GB of gp3.
  • Configure your Security Group with the following inbound rules:

Port Protocol Source Purpose

3389 TCP Your IP Remote Desktop (RDP) access

  • Select your EC2 key pair and launch the instance.
2

Retrieve the Windows password

Wait for the EC2 instance to pass its 2/2 status checks. Then retrieve the password:

  • Open the AWS Console and go to EC2 > Instances.
  • Select your instance.
  • Click Actions > Security > Get Windows password.
  • Click Browse and upload your EC2 key pair .pem file.
  • Click Decrypt password.
  • Note the Username (Administrator) and the decrypted Password.

Important: The Windows password can take up to 15 minutes after launch to become available.

3

Connect via Remote Desktop

Open your Remote Desktop client.

On Windows:

  1. Press Win + R, type mstsc, and press Enter.
  2. Enter the public IP address of your instance.
  3. Click Connect.

On macOS:

  1. Open Microsoft Remote Desktop.
  2. Click Add PC and enter the public IP address.
  3. Double-click the connection to connect.

When prompted, enter the following credentials:

  • Username: Administrator
  • Password: the decrypted value from Step 2

If a certificate warning appears, click Continue to proceed.

4

Verify the Java installation

After you connect to the Windows desktop, open Command Prompt with the desktop shortcut, or press Win + R, type cmd, and press Enter.

Verify that Java is installed and accessible:

java --help

The command displays the Java usage information, including the available options and commands. To check the specific version, run:

java -version

Using Java

Compile and run a Java program:

  • Create a file named HelloWorld.java with the command: notepad HelloWorld.java
  • Enter the following code: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello from SecureAnyCloud on AWS!"); } }
  • Compile the program with the command: javac HelloWorld.java
  • Run the program with the command: java HelloWorld

Run a JAR file:

java -jar your-application.jar

Check the JAVA_HOME environment variable:

echo %JAVA_HOME%

Server components

The following table lists the installed components and their versions.

Component Version

Java (JDK) Latest

Filesystem layout

The following tables describe the drive and the key directories.

Drive Description

C:\ System drive with Windows and Java installation

Key directories:

Directory Purpose

C:\Program Files\Java Java JDK installation

C:\Users\Administrator User home directory

C:\Users\Administrator\Documents Default working directory

Troubleshooting

Java command not found

  • Open Command Prompt and run java -version.
  • Verify that JAVA_HOME is set: echo %JAVA_HOME%
  • Check that the PATH variable includes the Java bin directory: echo %PATH%
  • If Java is not in PATH, add it manually: set PATH=%PATH%;C:\Program Files\Java\jdk-<version>\bin

Cannot connect via RDP

  • Verify that the instance has passed its 2/2 status checks.
  • Check that your security group allows port 3389 from your IP address.
  • Wait up to 15 minutes for the Windows password to become available.

Out-of-memory errors when running Java applications

  • Increase the JVM heap size: java -Xmx4g -jar your-application.jar
  • Consider upgrading to a larger EC2 instance type.
  • Monitor memory usage in Task Manager.

Security recommendations

  • Change the Administrator password after your first login.
  • Restrict RDP access: allow port 3389 only from your specific IP address.
  • Enable Windows Update: keep the OS patched with the latest security updates.
  • Keep Java updated: regularly check for and apply Java security updates.
  • Use strong passwords: set a complex password for the Administrator account.
  • Consider a VPN: for regular access, connect through a VPN instead of exposing RDP directly.

Support

If you run into any issues with this product, contact SecureAnyCloud support:

  • Email: sales@secureanycloud.com
  • Website: secureanycloud.com
  • Support hours: 24/7, with a guaranteed 24-hour response SLA

Deploy on AWS

Launch Java on Windows with 24/7 support from SecureAnyCloud.

View on Marketplace

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on AWS

Launch Java on Windows with 24/7 support from SecureAnyCloud.

View on Marketplace

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com