If i take the lab will I able to write the Spark Java code and execute there? If i can write how will i run it ?
Yes, you can execute that.
You will have to compile the JAR in your local machine. Upload the JAR to cloudxlab and run it using spark-submit command. For more updates, please see this project