Solved

Basic java question

Posted on 2002-04-11
9
255 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
runtime exception 2 41
jboss 7.1 start up error 1 28
Is Applet the way to go for my drag and drop system? 8 25
Java 8 to Java 6 8 20
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

808 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