I have no clue what is wrong
my path for javac is set to C:\Program Files\Java\jdk1.7.0\bin which is the default. I wrote out the Hello world program from my new book. its path is c:\document and settings\user\My Documents\myJavaPgms I cannot get the javac to run the file. Any guesses?
I tried it both of these ways....
C:\Documents and Settings\user>cd my documents\myJavaPgms
C:\Documents and Settings\user\My Documents\myJavaPgms>javac Hello.java
Error: Could not find or load main class com.sun.tools.javac.Main
C:\Documents and Settings\user\My Documents\myJavaPgms>cd C:\Program Files\Java\
jdk1.7.0\bin
C:\Program Files\Java\jdk1.7.0\bin>javac Hello.java
javac: file not found: Hello.java
Usage: javac <options> <source files>
use -help for a list of possible options
Re: I have no clue what is wrong
Did you put in your environment variable?
Re: I have no clue what is wrong
Yep...
C:\Documents and Settings\user>path
PATH=C:\Program Files\AMD APP\bin\x86;C:\WINDOWS\system32;C:\WINDOWS;C:\WIND OWS\
System32\Wbem;C:\WINDOWS\system32\WindowsPowerShel l\v1.0;C:\Program Files\Common
Files\Roxio Shared\DLLShared\;C:\Program Files\ATI Technologies\ATI.ACE\Core-St
atic;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.7.0\bin
Re: I have no clue what is wrong
Here's a tutorial to make sure you did the correct steps..
Java Tutorial: Java For Beginners (Part 1): Getting Started - YouTube
and you can skip to part 1:30 to installing env. variable part, since you already have
Re: I have no clue what is wrong
OK Shzylo,
I uninstalled Java and completed the process exactly how it was done in the video and I am still receiving the same error. :(
Any other suggestions?
Re: I have no clue what is wrong
Hmm..
can you give some screen shots?
You can search "snipping tool" and it will allow you to select a part of your screen, and save it as an image. Do that with your environment variable.
1 Attachment(s)
Re: I have no clue what is wrong
Re: I have no clue what is wrong
Re: I have no clue what is wrong
1. Can you please put here your Hello.java file , just to see the code
2. Also take the "commad prompt" and type the following command
javac -version
Check that the command prompt display you the java version as below eg ;
"javac 1.7.0_05"
Re: I have no clue what is wrong
1. public class Hello
{
public static void main(String[] args)
{
System.out.printIN("Hello, world!");
}
}
2. When i did the version it came up with
Javac 1.7.0_10
Re: I have no clue what is wrong
Hi ,
There is one error in your code. Check Line number 5
Wrong usage of print statement, you should use "println" and not printIN
Please correct the above mentioned error and try it !!! This should work without any issues.
Re: I have no clue what is wrong
Thanks mike
I changed that line but it still will not work.
It still gives me the error: Could not find or load main class com.sun.tools.javac.Main
Still not sure what the problem is. I may try to install Java on another computer. Any more ideas?
Re: I have no clue what is wrong
Now i even tried using my notebook to do it and I am still getting the same error messages. Maybe i need to find an older build?
Re: I have no clue what is wrong
create an account in Oracle | Hardware and Software, Engineered to Work Together first, then login to that site, paste this link in address bar and download jdk1.7.0 for windows-64 (for 32 bit OS) or windows-86(for 64 bit OS) by clicking the radio button "Accept Licence Aggrement" which you can see at there.
Java SE Development Kit 7 Downloads
then install newly. ok.. finally set the path, by typing on the command prompt as like the instructions given below. Before starting to do the following steps now see the "java" folder under c:\program files
and now navigate to till bin directory and when you open that bin folder you see many jar files and application files. check javac and java files are there.. now right click it and choose properties then copy its location.. it will be like c:\program files\java\jdk some thing and finally ends with bin..
now click
Start-> Run
Type: cmd
then just type as
set path=""
right click by ensuring the cursor within the double quotes and paste the location which you have copied within that double quotes.
now you run the program here..
Sorry for Spoonfeeding..
Re: I have no clue what is wrong
Thank you very much. Not sure why that worked but it does.
Re: I have no clue what is wrong
does the java and javac working properly?
then fine. thank you
R.R. Vigneshwaran..