wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes File structure and code question? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "File structure and code question?" Watch "File structure and code question?" New topic
Author

File structure and code question?

Tes Carter
Greenhorn

Joined: Jun 19, 2005
Posts: 4
In a class that I�m taking we are to adhere to a certain file structure and I�ve been teaching myself using a simple text editor and command prompt. What I�ve learned to this point is that I need to save java files under the JDK/bin in order to compile them. I�ve tried to save the required files in the bin only to have the java files unable to compile. I�m I missing something in the logic?

Also could someone tell me what this line of code is saying?

coinAmount % = 25;

Thank you in advance.
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
For the second problem, this isn't actual Java code - the percentage sign should not be there. Perhaps it is the second problem which is stopping you being able to compile your code.

Can you post the code you are trying to compile, the exact commands you are typing, and the error messages you are getting please?
sameer inamdar
Ranch Hand

Joined: Jul 04, 2005
Posts: 40
Tres

You seem the first and the most fundamental error which is made when some one tries to complile java it gets compiled but when its runnning you get class not found error.

U need to read about setting CLASSPATH variable which is used by the java runtime. and please see that the proper include statements are there in ur source code.

Please go through the fundamentals how the java interpreter runs and How classess are visible to it.

There is link in the FAQ go thru the FAQ


Dream!!! Set Vision !! Transform Vision to Mission by Actions on Deadlines!.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
amount %= 25;

is valid Java. It's shorthand for

amount = amount % 25;

which gives you the remainder from amount / 25.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
Sorry, I read a space between the % and the = and figured he was trying to do something funny instead of seeing your (much more likely) answer.
Matt Fielder
Ranch Hand

Joined: Oct 27, 2004
Posts: 158
I think you guys are missing something with the requirement to save to the bin file.

javac, for example, is in the bin folder. When you compile, you would have to set the path on your system so that your comp knows how to find the bin folder so you don't have to type its entire path when running javac and java to compile and run a prog.

I'm guessing that either you don't have admin rights to the computers (maybe lab comps) to set the path or the teacher doesn't feel like going through the trouble of teaching the entire class to set it. I could add that maybe he just has no clue, but I'll be nice.

You can save your Java files wherever you want and still compile them. Set a path to the bin folder to avoid all this headache. There are instructions at sun's site in the same place where you DL the jdk.

Make sense?

EDIT:
ok so I went and found the link.

installation instructions
 
jQuery in Action, 2nd edition
 
subject: File structure and code question?
 
Similar Threads
How how compile source files of .jar File?
How to set class path or whatever it is
classpath problem
Class in Eclipse won't go away...and now it doesn't compile
Not able to save a java program