RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 2097 | Replies: 10
Reply
Join Date: Jul 2005
Location: massachusetts
Posts: 12
Reputation: asatrujesus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
asatrujesus asatrujesus is offline Offline
Newbie Poster

Im really close but need help

  #1  
Jul 17th, 2005
Okay, when I first started trying to teach java to myself, I picked up a book called "Java: A beginners guide" by Herbert Schildt. I thought compiling was going to be as easy as c, I was of course wrong. Well through various searches I've figured out how to get javac to run by chaning the PATH variable, but it seems like it's not actually compiling my Exaple4.java file
It says:
javac: no source files
Usage: javac <options> <source files>
where possible opitions include:
blah blah (list of options)
Okay, no clue if it's compiled i think not, but then it throws an example4.html file in /demo/applets/animator, demo/applets/GraphLayout, demo/applets/WireFrame, demo/plugin/applets/animator, demo/plugin/applets/GraphLayout, and demo/plugin/applets/WireFrame

AND it throws a TableExample4.java file into demo/jfc/TableExample/src, and demo/plugin/jfc/TableExample/src.

I have no idea what is going on here, Im just so confused, and all these explanations I read are so vague. I've read some pretty great ones from the generous people here, and I thought you all might be able to help me. Because unless I can compile files I can't begin learning the language, first thing is first you know. Thanks to any who may reply.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation: server_crash is on a distinguished road 
Rep Power: 9
Solved Threads: 18
server_crash's Avatar
server_crash server_crash is offline Offline
Postaholic

Re: Im really close but need help

  #2  
Jul 17th, 2005
How are you compiling this??

are you using the form:

javac ProjectName.java


to run

java ProjectName


Have you changed your CLASSPATH variable?
Reply With Quote  
Join Date: Jul 2005
Location: massachusetts
Posts: 12
Reputation: asatrujesus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
asatrujesus asatrujesus is offline Offline
Newbie Poster

Re: Im really close but need help

  #3  
Jul 17th, 2005
Yes Im using the command console, and the commands javac file.java, and java file.
I set the classpath to the location of my file, via:
Javac -classpath c:\javastuff\file.java

I know it's doing SOMETHING because as I said it's putting those strange files in about 8 different folders with in the JDK folder. How do I know if it's working?
Reply With Quote  
Join Date: May 2005
Posts: 80
Reputation: indianscorpion2 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
indianscorpion2 indianscorpion2 is offline Offline
Junior Poster in Training

Re: Im really close but need help

  #4  
Jul 17th, 2005
you have to compile the java program with the same directory in which you saved the source file.this will definitely work.
Reply With Quote  
Join Date: Jul 2005
Location: massachusetts
Posts: 12
Reputation: asatrujesus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
asatrujesus asatrujesus is offline Offline
Newbie Poster

Re: Im really close but need help

  #5  
Jul 17th, 2005
I don't know how to explain it better, I've stated every bit of information i've recieved. Obviously if the javac program is creating new files in various directories within the JDK folder, it has done something. But yet it says there is no source file, so what did it do? and the files it made are not class files, they are .html files, and .java files.

If it worked correctly there would be one executable file right? How do i get it to work, and how do i know it worked. I am new enough at this where I really could use some very detailed help, I've given all the information i know, and the evidence is clear that it's not that javac doesn't see the file, because that produces a different error message. In fact it doesn't produce an error message, it says just what I typed into the first post I wrote.

There's got to be an awsner, and if you've already told it to me (which i don't think has happened, because the stated solutions are about setting the classpath so that javac can find the file, which we know from the evidence that it already has) im too dumb for that level of detail, I require more detail please.

god i must sound like an *******, im really sorry if i came off as that, im just frusterated and desperate.
Reply With Quote  
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: Im really close but need help

  #6  
Jul 17th, 2005
Hi everyone,

Are your source code packaged in the wrong folder. I usually get this error when i forget to change the package name.

Anyways you can read the below two threads for extra info

http://java.sun.com/developer/online...1/compile.html
http://java.sun.com/docs/books/tutor...ted/index.html

Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote  
Join Date: Jul 2005
Location: massachusetts
Posts: 12
Reputation: asatrujesus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
asatrujesus asatrujesus is offline Offline
Newbie Poster

Re: Im really close but need help

  #7  
Jul 17th, 2005
I've finally found the awnser, and perhaps one of the better classpath explanations on the web.

This super helpful link can be found here: http://www.kevinboone.com/classpath.html
Reply With Quote  
Join Date: Mar 2004
Posts: 733
Reputation: Phaelax is on a distinguished road 
Rep Power: 6
Solved Threads: 32
Phaelax Phaelax is offline Offline
Master Poster

Re: Im really close but need help

  #8  
Jul 18th, 2005
For first time users, I recommend downloading BlueJ. Install JRE 1.4(or 5) SDK into its default directory. Make some class in BlueJ then hit "compile". Right-click and run your main method.
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 19
Solved Threads: 200
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Im really close but need help

  #9  
Jul 18th, 2005
no, beginning users shouldn't use any IDE.
It prevents them from learning the basics by hiding those basics from them.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: Im really close but need help

  #10  
Jul 19th, 2005
Hi everyone,

You can use a no frills ide called Java IDE 1.7
It seems to be a very simple ide to use and free. This ide is something like borland's
turbo c compiler.

Yours Sincerely

Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:06 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC