cannot read Hello.java

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2008
Posts: 4
Reputation: rroky is an unknown quantity at this point 
Solved Threads: 0
rroky rroky is offline Offline
Newbie Poster

cannot read Hello.java

 
0
  #1
Apr 26th, 2008
Please any one can help at this problem I have with javac.
I have download the java jdk1.5.0_15 at least 20 times in three (3) machins and it do not compile. Actualy it can not read the file. Javac is installed and is on bin,
when I type javac it brings the manue. But my problem is not reading the file.java.
I have saved the file Hello.java on desktop, do not work. On bin where the javac is and still not work, I have set the path and it still not work any idea what is the wrong. I have used java 1.5.0_0 before three years and I have compile the codes, but after I have rebote the computer from facrory siting I have lost that and this semester I have to use the java for my project. Please if any one can halp.
Thanks
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,828
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 501
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: cannot read Hello.java

 
0
  #2
Apr 27th, 2008
Originally Posted by rroky View Post
Please any one can help at this problem I have with javac.
I have download the java jdk1.5.0_15 at least 20 times in three (3) machins and it do not compile. Actualy it can not read the file. Javac is installed and is on bin,
when I type javac it brings the manue. But my problem is not reading the file.java.
I have saved the file Hello.java on desktop, do not work. On bin where the javac is and still not work, I have set the path and it still not work any idea what is the wrong. I have used java 1.5.0_0 before three years and I have compile the codes, but after I have rebote the computer from facrory siting I have lost that and this semester I have to use the java for my project. Please if any one can halp.
Thanks
What are the exact error messages and what exactly are you doing, plus what OS are you using?
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 4
Reputation: rroky is an unknown quantity at this point 
Solved Threads: 0
rroky rroky is offline Offline
Newbie Poster

Re: cannot read Hello.java

 
0
  #3
Apr 27th, 2008
Hi and thanks for your reply. As I said it cannot read Hello.java.
It can not read the file.
I have saved as java file and when I open Properties of my file it is saying JAVA File. So the file is on my computer and the path is working because when I type path it gives the path and tha javac is working, but it can not read the file, I am having so bad luck for my project.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 4
Reputation: rroky is an unknown quantity at this point 
Solved Threads: 0
rroky rroky is offline Offline
Newbie Poster

Re: cannot read Hello.java

 
0
  #4
Apr 27th, 2008
I have XP window and HP palvion computer
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,828
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 501
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: cannot read Hello.java

 
0
  #5
Apr 27th, 2008
Originally Posted by rroky View Post
Hi and thanks for your reply. As I said it cannot read Hello.java.
It can not read the file.
I have saved as java file and when I open Properties of my file it is saying JAVA File. So the file is on my computer and the path is working because when I type path it gives the path and tha javac is working, but it can not read the file, I am having so bad luck for my project.

What's the EXACT error message and what command are you giving it on the command line when you you get that error, and do you ever get any .class files? You describing it in English is fine, but listing the actual Java error message gives more information. I'm looking for something like this:

Exception in thread "main" java.lang.NoClassDefFoundException:haha
Caused by: java.lang.ClassNotFoundException: haha
.
.
.
etc.
.
.
I got this error (intentionally) by typing "java haha" in a directory where there is no "haha.class" file. There are all sorts of errors you can get, following all sorts of commands. Which one are you getting? Are you getting it when you type:
  1. javac *.java
on the command line? If you get any ".class" files, you are at least compiling something. If you get the ".class" files, but then you can't run them successfully, that's a different error.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 4
Reputation: rroky is an unknown quantity at this point 
Solved Threads: 0
rroky rroky is offline Offline
Newbie Poster

Re: cannot read Hello.java

 
0
  #6
Apr 27th, 2008
I again, no class file.
It gives 1 error
cannot read: Wecome.java.
and if i type java Welcome it will give this error Exception in thread "main" java.lang.NoClassDefFoundException:Welcome
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 9
Reputation: sukatoa is an unknown quantity at this point 
Solved Threads: 2
sukatoa sukatoa is offline Offline
Newbie Poster

Re: cannot read Hello.java

 
0
  #7
Apr 28th, 2008
cannot read: Wecome.java.
and if i type java Welcome it will give this error Exception in thread "main" java.lang.NoClassDefFoundException:Welcome
Wecome and Welcome is not the same...
For humans, it is understandable, but for Machines, they don't accept it.

If you just mistyped it,

Here is the last option,
If your main class ( public class ) is Welcome, then save it first into Welcome.java

Copy that file into the bin folder where javac.exe exists,
run terminal ( CMD for windows )
Go to the bin folder.
As usual, type javac Welcome.java
If there is an error again, im 100% sure, there is a problem on your code.

And that error should be posted here in order for our experts to advice you immediately.

regards,
sukatoa
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC