Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7072

Issues with running a compiled java program

$
0
0

I am a Java beginner. I wrote a quintessential "Hello, World!" program. It compiles, but won't run. The terminal says there is an exception in the thread main, and that the class hello is not found. I am using Ubuntu 12.04. What could be wrong here?

The file is called hello.java.

The commands I used:

$javac hello.java
$java hello

My code is below:

class hello{public static void main(String[] args) {    system.out.print("Hello");  }}

EDIT-----------------------------------------------------------------------------------------

I just realized that I am using openjdk7. Does that pose a problem?


Viewing all articles
Browse latest Browse all 7072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>