Solved

Basic java question

Posted on 2002-04-11
9
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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
 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

622 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