Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35113

Re: Is it necessary the source file should be at the same location with the class file?

From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Is it necessary the source file should be at the same location with the class file?
Date 2016-07-23 19:05 -0400
Organization Aioe.org NNTP Server
Message-ID <nn0t8n$17np$1@gioia.aioe.org> (permalink)
References <nn07hl$8ti$1@gioia.aioe.org>

Show all headers | View raw


On 7/23/2016 12:55 PM, parmenides wrote:
> I try to understand the relationship of the souce file and the class
> file.

> It seems that the source file should be at the same location as the
> class file.Is this right? Why the compiling is wrong?

For small projects you can use .java and .class files in same dir tree
matching package structure.

projectroot/mypackage/MyClass.java
projectroot/mypackage/MyClass.class

Remember to have projectroot in classpath.

For bigger projects then I will recomment having a src tree and a bin
tree for .java and .class respectively.

projectroot/src/mypackage/MyClass.java
projectroot/bin/mypackage/MyClass.class

Remember to have projectroot/bin in classpath.

Arne

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Is it necessary the source file should be at the same location with the class file? parmenides <xparmenides@yahoo.com> - 2016-07-24 00:55 +0800
  Re: Is it necessary the source file should be at the same location with the class file? Steven Simpson <ss@my.domain.invalid> - 2016-07-23 20:10 +0100
  Re: Is it necessary the source file should be at the same location with the class file? Arne Vajhøj <arne@vajhoej.dk> - 2016-07-23 19:05 -0400
    Re: Is it necessary the source file should be at the same location with the class file? Steven Simpson <ss@my.domain.invalid> - 2016-07-24 08:42 +0100
      Re: Is it necessary the source file should be at the same location with the class file? Arne Vajhøj <arne@vajhoej.dk> - 2016-07-24 07:47 -0400
        Re: Is it necessary the source file should be at the same location with the class file? Steven Simpson <ss@my.domain.invalid> - 2016-07-24 22:08 +0100
          Re: Is it necessary the source file should be at the same location with the class file? Martin Gregorie <martin@address-in-sig.invalid> - 2016-07-24 21:28 +0000
          Re: Is it necessary the source file should be at the same location with the class file? Arne Vajhøj <arne@vajhoej.dk> - 2016-07-24 18:06 -0400
            Re: Is it necessary the source file should be at the same location with the class file? Steven Simpson <ss@my.domain.invalid> - 2016-07-25 21:21 +0100
              Re: Is it necessary the source file should be at the same location with the class file? Arne Vajhøj <arne@vajhoej.dk> - 2016-07-25 21:03 -0400
    Re: Is it necessary the source file should be at the same location with the class file? Roedy Green <inquiry@mindprod.com> - 2016-07-26 15:24 -0700
  Re: Is it necessary the source file should be at the same location with the class file? Arne Vajhøj <arne@vajhoej.dk> - 2016-07-23 19:06 -0400

csiph-web