Command Prompt cannot find class in my Java program
Closed
zlloyd1
Posts
10
Registration date
Tuesday 11 December 2012
Status
Member
Last seen
4 February 2013
-
11 Dec 2012 à 00:38
shoaibista Posts 8 Registration date Friday 24 May 2013 Status Member Last seen 27 May 2013 - 24 May 2013 à 11:10
shoaibista Posts 8 Registration date Friday 24 May 2013 Status Member Last seen 27 May 2013 - 24 May 2013 à 11:10
Related:
- Command Prompt cannot find class in my Java program
- Send message through command prompt - Guide
- Rename computer command prompt - Guide
- Disable deep freeze from command prompt - Guide
- Cs 1.6 money command - Guide
- Command prompt commands list - Guide
2 responses
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
12 Dec 2012 à 18:43
12 Dec 2012 à 18:43
you class is not in the path. Java is unable to find the class
most common way would be that you change dir to the location of the file and then execute the program
most common way would be that you change dir to the location of the file and then execute the program
shoaibista
Posts
8
Registration date
Friday 24 May 2013
Status
Member
Last seen
27 May 2013
24 May 2013 à 11:10
24 May 2013 à 11:10
->javac guihelloworld.GUIHelloWorld
try this
try this
12 Dec 2012 à 20:03
public static void main(String[] args){
JOptionPane.showMessageDialog(null, "HELLO WORLD");}}
So, I cannot for the life of me figure out what is the problem resulting in this error....
13 Dec 2012 à 12:37
package guihelloworld;
So the class must reside in folder "guihelloworld"
Other issue with your code is
/ * HELLO WORLD Interface*/
there cannot be space between / and * for it to be a comment
try this. I have removed your package statement. So now if you cd to the location of the compiled class and run the
javac GUIHelloWorld
it would word
/**Zachariah A Lloyd * Hello World Graphical User Interface.... */ import javax.swing.JOptionPane; public class GUIHelloWorld { public static void main(String[] args){ JOptionPane.showMessageDialog(null, "HELLO WORLD");}}