473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Package and compiling

Isa
Hi!
I have a question about the package and Java class files. I hope someone can
answar me. When I compile a java source file with a package statement I
expect that the compiler should create the package directories and put the
class file there.
For example:

package homecompany.utilies;
public class graph{
....
}

The command C:\ javac graph.java compiles and create the class file
graph.class
in the same directory. I suppose that the class file graph.class should
placed in the
directory C:\homecompany\utilies\, but it does not. The development env. is
windows xp with Java SDK 1.4_2.

Thanks to any comment
Isa

Jul 17 '05 #1
3 5857


"Isa" <is**************@comhem.se> wrote in message
news:_U********************@newsc.telia.net...
Hi!
I have a question about the package and Java class files. I hope someone can answar me. When I compile a java source file with a package statement I
expect that the compiler should create the package directories and put the
class file there.


Wrong.
http://java.sun.com/docs/books/tutor.../packages.html
--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
Jul 17 '05 #2
"Isa" <is**************@comhem.se> wrote in message news:<_U********************@newsc.telia.net>...
Hi!
I have a question about the package and Java class files. I hope someone can
answar me. When I compile a java source file with a package statement I
expect that the compiler should create the package directories and put the
class file there.
For example:

package homecompany.utilies;
public class graph{
...
}

The command C:\ javac graph.java compiles and create the class file
graph.class
in the same directory. I suppose that the class file graph.class should
placed in the
directory C:\homecompany\utilies\, but it does not. The development env. is
windows xp with Java SDK 1.4_2.

Thanks to any comment
Isa


Mapping between java package and system directory structure is
not automatic default. See Java Language Specification chapter 7.
Jul 17 '05 #3
Isa wrote:
Hi!
I have a question about the package and Java class files. I hope someone can
answar me. When I compile a java source file with a package statement I
expect that the compiler should create the package directories and put the
class file there.
For example:

package homecompany.utilies;
public class graph{
...
}

The command C:\ javac graph.java compiles and create the class file
graph.class
in the same directory. I suppose that the class file graph.class should
placed in the
directory C:\homecompany\utilies\, but it does not. The development env. is
windows xp with Java SDK 1.4_2.

Thanks to any comment
Isa


First, get the JDK documentation from Sun. Part of the documentation is
"Tool Documentation" and that will tell you lots of things about javac,
java, etc.

What you want is the -d option to javac.

Ray
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rui Pacheco | last post by:
Hi I am developing an Swing applet. I am using Eclipse as my IDE and I am compiling the classes through the command line. Everything went ok, but suddenly it started to give the error "Package...
1
by: news.verizon.net | last post by:
What grammer requires that an import must be for a package? The following gets an error: dir structure: -------- src\ HelloImport.java examples\ HelloWorld.java
1
by: Andres Baravalle | last post by:
Hi, I am quite new with python and I'm developing a package that is including a binary file (eggtrayiconmodule.so) that is open source. My software is developed in part under linux, and now I...
2
by: Lars Uffmann | last post by:
Hello everyone! I am trying to run a very minor .net-application (autopatcher for a free everquest server) while avoiding to actually install the 23megabytes .net basic package that Microsoft...
4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
11
by: Brett Romero | last post by:
If I create a DLL (my.dll) that references other DLLs, how do I make sure other developers only need my.dll and not all of the other DLLs it references? Is there a way to compile the references...
2
by: mivey4 | last post by:
Hi, I am not new to Oracle but I am new to creating packages. Trying to convert to Oracle from MSSQL and getting my feet wet I have created the following package that has 1 procedure in it. No...
1
by: Gheorghe Postelnicu | last post by:
Hi, I have Python 2.5 installed on WinXP and I am trying to install a new package. I ran the setup.py build and I get the following message: C:\packages\reedsolomon-0.1>setup.py build running...
3
by: =?Utf-8?B?U3VzYW4=?= | last post by:
I am attempting to create an installation package for a 64 bit system with Visual Studio 2005. The machine on which I am compiling and creating the package is also 64 Bit. I have the 64 Bit .Net...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.