I am very new to linux environment.
I am trying to run a simple hello world Java class in linux environment.
Hey. java
package com.util; public class Hello { public static void main(String[] args) { System.out.println("hi"); } }
I compiled the java class on Windows and uploaded the .class file to the linux system in the path / home / scripts.
my command is as follows:
java -cp /home/scripts com.util.Hello
when I execute this command from the same / home / scripts where Hello.class I get
Error: could not find or load the main class com.util.Hello and continue no further.
Can someone help me on this?
java linux shell
user1660325
source share