You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Understanding how JAS loads classes

By default whenever JAS3 compiles new classes it puts the resulting .class files into the directory ~/.jas3/classes. This directory is included by default in the list of directories from which JAS3 loads classes, also known as the CLASSPATH.

These defaults were choosen to make things simple for beginners, they can open .java files from any directory, compile them, and load the resulting class without having to worry about setting CLASSPATH, or even knowing what it is. However these defaults are different from the Java compiller's normal default, which is to put compiled classes into the same directory as the source code.

For more advanced users it is quite simple to restore the more usual Java behaviour. From the menu chooser View, Preferences, and click on the "Java, Compiler" item in the preferences tree, then turn off the "Redirect output to:" option. This will restore the Java compiler's default behaviour.

Once you have done this then you will probably also have to set JAS3's buillt-in Classpath. This is also done from the preferences dialog, using the "Java, Classpath" option. You will need to set Classpath to include all the directories from which you want JAS3 to load classes. (More accurately if you .java code contains a package statement, putting your code into a package other than the default directory

  • No labels