compiling of classes 922

Hi,

I am a newbie to IntelliJ, just escaped the claws of Eclipse and Netbeans. I
have just started using Aurora 922 and cannot find a way to compile x.java
file and have the compiled x.class file reside in the same folder of the
x.java file.
The x.class file is allways placed in the output folder (build folder).

Any ideas !

Peter Lerche
http://EasySpeedy.com

7 comments
Comment actions Permalink

just set up the output directory to point to the source directory, e.g, if you sources are in
C:\myproject\src, your output directory should be also C:\myproject\src
If you have multiple source directories, you'll have to create a separate module per each source directory and set up the module's
output directory to be the same as its source directory.

BTW, what advantages you get when storing .class files together with .java files?

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"

"Peter Lerche" <peter@easyspeedy.com> wrote in message news:bjpbb5$r49$1@is.intellij.net...

Hi,

>

I am a newbie to IntelliJ, just escaped the claws of Eclipse and Netbeans. I
have just started using Aurora 922 and cannot find a way to compile x.java
file and have the compiled x.class file reside in the same folder of the
x.java file.
The x.class file is allways placed in the output folder (build folder).

>

Any ideas !

>

Peter Lerche
http://EasySpeedy.com



0
Comment actions Permalink

Why do you want the class file in the same folder as the source? That's
generally regarded as a Bad Idea. Certainly keeping them separate makes it
easier to do things like create jar files for distribution, to do a complete
rebuild by deleting all the class files, etc. I'd really recommend
organising your project this way instead - you'll be better off for it.

If you're determined to have the class file in the same directory as the
source, you could try setting the output directory to the same place as your
source folder. Be warned though: if you do this, you run the risk of having
your source files deleted. You'll need to make sure that the "Clear output
directory on rebuild" checkbox (under Project Properties > Compiler) is NOT
checked.

Vil.


Peter Lerche wrote:

Hi,

I am a newbie to IntelliJ, just escaped the claws of Eclipse and Netbeans. I
have just started using Aurora 922 and cannot find a way to compile x.java
file and have the compiled x.class file reside in the same folder of the
x.java file.
The x.class file is allways placed in the output folder (build folder).

Any ideas !

Peter Lerche
http://EasySpeedy.com


--
Vilya Harvey
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

Disclaimer

This e-mail and any attachments may be confidential and/or legally
privileged. If you have received this email and you are not a named
addressee, please inform the sender at Digital Steps Ltd by phone on
+44 (0)1483 469 480 or by reply email and then delete the email from
your system. If you are not a named addressee you must not use,
disclose, distribute, copy, print or rely on this email. Although
Digital Steps Ltd routinely screens for viruses, addressees should
check this email and any attachments for viruses. Digital Steps Ltd
makes no representation or warranty as to the absence of viruses in this
email or any attachments.

0
Comment actions Permalink

your source files deleted. You'll need to make sure that the "Clear output
directory on rebuild" checkbox (under Project Properties > Compiler) is NOT
checked.


It is off by default.
And even if the option is checked, in case an output directory overlaps with a source directory, you'll get a warning, and nothing
will be deleted.

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


0
Comment actions Permalink

Eugene Zhuravlev (JetBrains) wrote:

It is off by default.
And even if the option is checked, in case an output directory overlaps with a source directory, you'll get a warning, and nothing
will be deleted.


Oh, that's good to know. Thanks!

Vil.
--
Vilya Harvey
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

Disclaimer

This e-mail and any attachments may be confidential and/or legally
privileged. If you have received this email and you are not a named
addressee, please inform the sender at Digital Steps Ltd by phone on
+44 (0)1483 469 480 or by reply email and then delete the email from
your system. If you are not a named addressee you must not use,
disclose, distribute, copy, print or rely on this email. Although
Digital Steps Ltd routinely screens for viruses, addressees should
check this email and any attachments for viruses. Digital Steps Ltd
makes no representation or warranty as to the absence of viruses in this
email or any attachments.

0
Comment actions Permalink

How do you add multiple modules? All I see in Project Properties is the 'Main Module'. I can add a lot of 'Content' to that Main Module, including a whole pile of src paths, but no way to specify different output paths per source path (that I can see).

Our project has 22 different src directories, all with their own compile directory. Obviously I'm very interested in the solution to this problem.

Rob.

0
Comment actions Permalink

How do you add multiple modules? All I see in Project Properties is the

'Main Module'.

Not yet here. Modules will come in their own time.


0
Comment actions Permalink

Not yet here. Modules will come in their own time.


Yes, the UI for multiple module configurations is being designed/implemented now. But you can modify the project files in the text
editor (IDEA for example :) and that will work. The structure of each module is described in the corresponding file with the
extension "iml". Just copy already existing iml file for the "Main" module and modify it to point to other directories. Do not
forget to "register" additional iml files in the "ipr" file like this

-- Best regards, Eugene Zhuravlev JetBrains, Inc, http://www.intellij.com "Develop with pleasure!" "Carlos Costa e Silva" ]]> wrote in message news:bjqunc$cb2$1@is.intellij.net...

How do you add multiple modules? All I see in Project Properties is the

'Main Module'.

>

Not yet here. Modules will come in their own time.

>
>


0

Please sign in to leave a comment.