Hello,
I'm new to Java and I am using JDK 1.8.0_72. I'm attempting to execute a .class file but I'm receiving the following error:
c:\Program Files\Java\jdk1.8.0_72\bin>java c:\java\GalToLit.java
Error: Could not find or load main class c:\java\GalToLit.java
I have set the CLASSPATH, PATH, and JAVA_HOME variables:
set PATH=C:\Program Files\Java\jdk1.8.0_72\bin
set CLASSPATH=C:\Program Files\Java\jdk1.8.0_72\lib
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_72
As I mentioned, I am new to Java and been searching the web for help in troubleshooting and nothing seems to work. The basic code is:
- class GalToLit {
- public static void main(String args[]) {
- double gallons;
- double liters;
-
- gallons = 10;
- liters = gallons * 3.7854;
-
- System.out.println(gallons + " gallons is " + liters + " liters.");
- }
- }
Please let me know if I need to provide more information. Thanks in advance for everyone's help.
Frank