Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: Where is Java class located on Linux systems? Date: Sat, 21 Jun 2014 23:52:09 -0700 Organization: A noiseless patient Spider Lines: 20 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 22 Jun 2014 06:52:12 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="9358cda03e1e0dfd3c4b757daa608707"; logging-data="9743"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ML87wM2NMr2cu/M2sNibHuPmGzIwqBlM=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:A16xaaBFD98ysTYMrLs2FFwZcps= Xref: csiph.com comp.lang.java.programmer:28813 On 6/21/2014 8:52 PM, Tom Tylor wrote: > For the "import ...;" lines, I just wonder where the class files are > located on my system. Can anyone help? > On the classpath. I'm a little fuzzy on the exact details, and it depends what tool you use (each IDE will have its own rules, for example) but generally speaking each tool will read the classpath to resolve any imports. http://docs.oracle.com/javase/tutorial/essential/environment/paths.html The latest compilers (javac) use a special abbreviated file to reference system classes. This doesn't include classes from rt.jar which you normally shouldn't access. So if a class from the sun.* hierarchy stops being located during a compile, you have to use a special little bit of magic to get javac to use the full rt.jar.