Compile and Run Java Programs with Codiva Online Compiler
Compile and Run Java Programs with Codiva Online Compiler

Preparing for your interviews? Practicing Data Structures and Algorithms? You need a quick way to run many short programs. Online IDEs are better suited for you than a Eclipse or simple text editor. There are a number of Online IDEs. In this post, we will review one of the best online Java compilers and IDEs – Codiva.io.

ide2 1024x672 - Compile and Run Java Programs with Codiva Online Compiler

Compiles on the fly

Codiva has some cool features. My favorite is, it compiles the code automatically after every few keystrokes. You type the code, you will immediately find if there are any compilation errors. You will see the red error mark, next to the line number on the left.

pasted image 0 - Compile and Run Java Programs with Codiva Online Compiler

Remember:
When writing code, most of the time, there will be compilation errors. In most of my tests, the compilation completed within a second after I typed. This is significantly better than the alternatives like Ideone, jdoodle,… where the you have to click ‘Run’ for it to compile.

I believe this will save you a lot of coding time, because you don’t have to switch between editor and console or click ‘Run’ a number of times.

223 1024x707 - Compile and Run Java Programs with Codiva Online Compiler

Run Interactive Programs with user input:

If you follow any Java Tutorials, there will be some programs that require user input. Codiva truly supports interactive programs. Run the code, the program will run and wait for you to enter your input, then continue running. The way you will expect. In most other alternatives, you will have to enter the input in a text box even before the program starts. This is very intuitive if you are just learning.

Long Running programs:

Most online IDEs can run program only for a few seconds. Codiva can run the code for upto 5 minutes. This is typically enough time to wait for user input, testing multithreading with locks,.

Streaming Output:

Typical online IDEs wait for the java program to complete, then dumps the entire result in one go on the browser. Where as, Codiva streams the results back to the server when the process is running.

Now:

Compare this same program in these two IDEs. https://ideone.com/0tVQYP and https://www.codiva.io/p/66134ee0-fd8e-46d4-94bd-859cb5a10bd9

As per the code, it is supposed to print the time every second for 10 seconds and exit. In ideone, it will wait for 10 seconds, and then display all 10 lines at once, but you will notice the time printed will be 1 second apart in each line. Where as codiva, you will correctly see the result printed once every second.

Multiple Files and Packages

Codiva supports creating multiple files and packages, unlike other online IDEs that force you to have a single class with a fixed class name.

Although this is not a big factor, but very useful when teaching Object Oriented Programming concepts like encapsulation and data hiding and to teach various scopes in Java.

Works on Mobile:

Although not many will code on mobile, it is still very useful for browsing and reading code that others shared. I tested it to work well on my Android phone. I haven’t tested on iPhone. If you could test on an iPhone, please comment your experience. If you plan to write code in mobile, I recommend Hacker’s Keyboard.

54 664x1024 - Compile and Run Java Programs with Codiva Online Compiler

One Click Setup:

This is an advantage of Online IDEs over desktop solutions. Open Codiva.io on your browser, and you can start coding instantly. No downloads. No installation. No PATH and JAVA_HOME variables. In Codiva, you can optionally create an account to keep track of your code.

Sharing

Online IDEs make it easy to share the code directly and others can easily run and try to see if it works. On Codiva, by default the project is private. Click Share and copy paste the URL to share a read only view.

You can also embed Codiva projects on your blog or your website.

Conclusion:

Codiva.io is a nice little tool to bookmark for Java Developers. It has some cool features, and shows that online IDEs have come a long way from just a text box to a fairly usable IDE.

AUTHOR

Khazin Muzaffar is a Tech enthusiastic, he writes about technology and all viral tech stuff. He is a senior editor and keeps eye on all tech related things.