I have access to amazon cloud service ec2, linux instance. I created vi first.java
file with this content:
class first {
public static void main(String[] args) {
System.out.println("abc");
}
}
I want to compile the file using:
[root@ip-21-24-273-243 ec2-user]# javac first.java
bash: javac: command not found
Command not found? I do:
[root@ip-21-24-273-243 ec2-user]# java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.9) (amazon-57.1.11.9.52.amzn1-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
So java is installed. How can I run a simple app?
[root@ip-21-24-273-243 ec2-user]# yum install java
Loaded plugins: priorities, security, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00
amzn-updates | 2.3 kB 00:00
Setting up Install Process
Package 1:java-1.6.0-openjdk-1.6.0.0-57.1.11.9.52.amzn1.x86_64 already installed and latest version
Nothing to do
Click the AWS icon on the Eclipse toolbar, and then click New AWS Java Project. In the dialog box that appears, type a name for the project in the Project name box and select Amazon Simple Queue Service Sample. Click Finish.
To deploy your Java Web Start application, first compile the source code, package it as a JAR file, and sign the JAR file. Java Web Start applications are launched by using the Java Network Launch Protocol (JNLP). Hence, you must create a JNLP file to deploy your application.
Step 1: Create an AWS Elastic Cloud Compute Instance. Step 2: Start the EC2 instance that you have created in Step 1. Step 3: Connect to your EC2 Instance by clicking on Connect Button. Step 4: A prompt will pop up after connecting.
You need to install java-1.6.0-openjdk-devel:
yum install java-devel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With