Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

Basic java question

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
theworpler
Asked:
theworpler
1 Solution
 
objectsCommented:
> what directory do I put the .java files in

Wherever you want, just add the directory to your classpath.
0
 
CEHJCommented:
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
 
rashidkamranbsCommented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
girionisCommented:
>> 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
 
objectsCommented:
> 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
 
MoondancerCommented:
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
 
MoondancerCommented:
Ignored/finalized.  Asker logged in again today and still hasn't handled these questions.  Administration once again advised.

Moondancer - EE Moderator
0
 
objectsCommented:
Thanks mate :-)
0
 
MoondancerCommented:
Sorry you had to wait so long, and thank you for your help.  :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now