Solved

Basic java question

Posted on 2002-04-11
9
229 Views
Last Modified: 2010-05-18
I want to write quick and dirty classes to
learn string , array etc techniques.  Just a few classes
created using notepad and then compile then with the command line and run them without the gooey. The kind of stuff you see in basic java books.

My question is:  what directory do I put the .java files
in - there is a particular location relative to my java set up - and how do I find it (jdk  1.xxx I seem to remember)

Sorry for the long question, but the answer will be a snap for a lot of you guys.....
0
Comment
Question by:theworpler
9 Comments
 
LVL 92

Accepted Solution

by:
objects earned 50 total points
ID: 6933357
> what directory do I put the .java files in

Wherever you want, just add the directory to your classpath.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 6933491
Create a 'projects' directory under your installation (<JAVA_HOME>) directory.
For rough work, I normally put things in <JAVA_HOME>\projects\misc, using no packages.
For more serious stuff, I create a new directory under projects, such as <JAVA_HOME>\projects\important.
0
 

Expert Comment

by:rashidkamranbs
ID: 6934249
There is no hard and fast rule until you use the package statement in your source file.. that  is you can place .java files any where in our directory structure but if you are using package statement for example

package mypackages.utils;

then its mendatory to put them in mypackages/utils directory .. no matter where these two are for example if  i m on windows machine
it could be

c:\projects\mypackages\utils

or it could be
c:\mainprojects\subprojects\mypackages\utils

but if there is no package statement then you are free and place ne where ya want..

as for JDK  if ya want to access the javac and java from anywhere.. then bin directory of the jdk installations should be in your system's path. or you  can execute by enterting the full path

0
 
LVL 35

Expert Comment

by:girionis
ID: 6937359
>> what directory do I put the .java files in
>Wherever you want, just add the directory to your classpath.

  Wherever you want but you do not have to put the directory in your classpath (although you could if you wanted to). Add to your classpath the directory where you keep your .class files and not the .java files (except if the .java and .class files are i nthe same subdirectory).
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 92

Expert Comment

by:objects
ID: 6937913
> except if the .java and .class files are i nthe same subdirectory

Sorry, as they were keeping things simple I was assuming that the class files were in the same directory.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6956579
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20136013.html
http://www.experts-exchange.com/questions/Q.20136061.html
http://www.experts-exchange.com/questions/Q.20136077.html
http://www.experts-exchange.com/questions/Q.20172167.html
http://www.experts-exchange.com/questions/Q.20177844.html
http://www.experts-exchange.com/questions/Q.20177845.html
http://www.experts-exchange.com/questions/Q.20177846.html
http://www.experts-exchange.com/questions/Q.20224162.html
http://www.experts-exchange.com/questions/Q.20268951.html
http://www.experts-exchange.com/questions/Q.20287427.html
http://www.experts-exchange.com/questions/Q.20287345.html
http://www.experts-exchange.com/questions/Q.20290450.html




*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations if this item remains inactive another seven (7) days.  If you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
POINTS FOR EXPERTS awaiting comments are listed here -> http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7074146
Ignored/finalized.  Asker logged in again today and still hasn't handled these questions.  Administration once again advised.

Moondancer - EE Moderator
0
 
LVL 92

Expert Comment

by:objects
ID: 7074289
Thanks mate :-)
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7074309
Sorry you had to wait so long, and thank you for your help.  :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countPairs challenge 7 58
strCopies  challenge 17 73
JDeveloper 12c for 32 bit 4 36
Java Timer (static) 9 18
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now