Hey guys I'm trying to compile my 1st Java program, can someone help me with my most recent error below. Thanks | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Hey guys I'm trying to compile my 1st Java program, can someone help me with my most recent error below. Thanks

Error: could not find or load main class ExampleProgram2.java

12th Dec 2016, 8:33 PM
Wayne Porter
Wayne Porter - avatar
20 Answers
+ 3
An integrated development environment (IDE) is a software suite that consolidates the basic tools developers need to write and test software. Typically, an IDE contains a code editor, a compiler or interpreter and a debugger that the developer accesses through a single graphical user interface (GUI). An IDE may be a standalone application, or it may be included as part of one or more existing and compatible applications.... Credits to google.
12th Dec 2016, 9:17 PM
Franky BrainBox
Franky BrainBox - avatar
+ 1
I'm not sure what you mean when you say show the code do you care to explain? thanks
12th Dec 2016, 8:35 PM
Wayne Porter
Wayne Porter - avatar
+ 1
OK thanks guys, here's my code public class ExampleProgram2 { public static void main (String[] args) { System.out.println("Hello World"); } }
12th Dec 2016, 8:44 PM
Wayne Porter
Wayne Porter - avatar
+ 1
do you guys just retype when posting code or is there a faster way?
12th Dec 2016, 8:45 PM
Wayne Porter
Wayne Porter - avatar
+ 1
I'm using cmd, I've tried for three different codes, what is ide & where can I find it
12th Dec 2016, 8:56 PM
Wayne Porter
Wayne Porter - avatar
+ 1
IDE means Integrated Development Environment. Its an application that helps you convert your sourceCode.java to sourceCode.jar. It just require you to click a button to compile your source code instead of typing commands to conpile your source code. You can download your IDE from google. I prefer Netbeans while alot of people prefer Eclipse .
12th Dec 2016, 8:59 PM
Franky BrainBox
Franky BrainBox - avatar
+ 1
cool man, thanks
12th Dec 2016, 9:00 PM
Wayne Porter
Wayne Porter - avatar
+ 1
so the Java archiver tool is a compiler on steroids?
12th Dec 2016, 9:05 PM
Wayne Porter
Wayne Porter - avatar
+ 1
thanks for all the help guys, I really appreciate it
13th Dec 2016, 5:54 AM
Wayne Porter
Wayne Porter - avatar
+ 1
hey guys I just downloaded netbeans EE, how do I open a hello world template?
14th Dec 2016, 6:22 AM
Wayne Porter
Wayne Porter - avatar
0
show the code
12th Dec 2016, 8:34 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
make sure you have "public static void main(String[] args)" function in your source code. make sure u spelt it correctly. Just show your code. members are willing to help.
12th Dec 2016, 8:39 PM
Franky BrainBox
Franky BrainBox - avatar
0
ya while helping others we also learn.. and by asking u to show the code.. I needed to see what actually u have missed while writing the code.. it could be any state of error
12th Dec 2016, 8:41 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
show the code simply means you should post your code here so that members can help you figure out why you are getting a compile error.
12th Dec 2016, 8:44 PM
Franky BrainBox
Franky BrainBox - avatar
0
well ur code has no error...
12th Dec 2016, 8:48 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
i cant figure out a typo or error on the code you posted. check your compiler . i am suspecting your compiler cant find the source code where its located in the directory.. Are you using IDE or cmd to compile?
12th Dec 2016, 8:51 PM
Franky BrainBox
Franky BrainBox - avatar
0
No actually IDE is abbreviated correctly.. but the main purpose of IDE is to enhance the programming and makes easier for users.. Some IDE's comes with Compiler and debugger as well.. And for .jar file.. Java has Java Archiver tool..
12th Dec 2016, 9:04 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
Look u can download JDK software from oracle.com it is enriched with Java compiler, Java Archiver tool, java code debugger And JRE (Java Runtime Environment- this is The IDE of JDK). And to explain u what a Java archiver is.. As u might have seen WinZip or WinRar or 7Zip.. to compress a file on windows... Similarly JDK uses Java Archiver tool to Compress ur source code of Java To .jar file... And this jar file can be used to install on a java based devices.
12th Dec 2016, 9:11 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
ya exactly @franky☺
12th Dec 2016, 9:18 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
have u made sure, that u navigated to your folder where ur file lies in? i think u use windows so on cmd it should look some like: C://users/wayne/desktop/crappyfoldername/ then type: javac exampleprogram2.java the crappyfoldername shall be the folder your .java lies in
12th Dec 2016, 10:48 PM
Loeschzwerg