Re: Command line compiler

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Those are the "prebuild", "postbuild" steps, not at all hard to add to VS. I've done it
frequently. I had a yacc parser that was a prebuild step and a version number incrementer
that is a postbuild step. In the case of building a DLL, you set the application to run
the DLL under as "java" with the appropriate command line.
joe

On 2 Jun 2006 23:04:08 +0200, Peter <p@xxxxxxxxxxxxxxxx> wrote:

Jonathan Wood <jwood@xxxxxxxxxxxxxxxx> wrote:
All I would say is: Try getting to the point where you are used to compiling
from the IDE and then see how the two methods compare. I won't say you
should do it one way or the other, but the vast majority of people using
this tool find the IDE far more easy and productive. And I think there are
valid reasons for this.

Just a thought.

No, I agree with you. Actually, I usually do use the VC++ IDE.

I'm basically a C/C++ programmer who was hired by a company that seems to
love Java (I was hired for my math knowledge, not my programming knowledge).
Part of my current project requires interfacing C and C++ with Java, so I've
been learning the JNI API

I've been working through a book on JNI, which requires that I create library
files. I've been following along with the examples and doing exercises both
on Windows and Linux.

Since for this particular purpose I need to write, edit, compile, and run
Java programs, the easiest thing to do (for me) is to use vim with
makefiles. So my Makefile entries would look something like:

0. Write the Java program.
1. Use javac to compile a .java to a .class file.
2. Use javah to generate a .h file from the .java file.
3. Implement the functions prototyped in the .h in a .cpp file.
4. Compile the .cpp file into a .dll (or .so) file.
5. Use java to run the .class file which loads the .dll (or .so) file.

I wouldn't know how to do all this with Visual Studio. However, with Make,
it's the simplest thing on the entire planet.

Since I created a template Makefile to do all this, whenever I work on a new
program, all I need to do is change the first line from:

TARGET = HelloWorld

to:

TARGET = IntArrayTest

and I'm done. It, quite literally, takes me 3 seconds. Two if I hurry. :)
I wouldn't know how to do this with Visual Studio.

But other than this, I often do use the the VS IDE.

I also use the command line stuff for little test or proof of concept
programs, like testing out the behavior of a particular function. I can
usually have the program written and compiled using command line tools by the
time I tell VS where to put a new project. Well... not quite. But
honestly, this isn't too much of a hyperbole. :)

But for larger projects on Microsoft Windows, I often do use the IDE.

Pete
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Java-Rauschen (war: Re: Getter & Setter)
    ... also stimmst du mir zu dass Java ohne IDE schlecht nutzbar ist? ... Nun mal abgesehen dass man APIs nicht mehr lernt, sondern sich einfach auf Codecompletion verlässt und dabei Hilfsklassen vollkommen ignoriert, ... Oder wenn der Grad des Rauschen so unterschiedlich ist? ...
    (de.comp.lang.java)
  • Re: Java-Rauschen (war: Re: Getter & Setter)
    ... welche Perspektive hatten denn die Leute, die Java entworfen haben? ... Aber gehe ich recht in der Annahme dass du dann sagst, dass Java erst durch eine IDE "richtig gut" wird?... ... Ich sehe es allerdings für eine textbasierte Programmiersprache als Nachteil an, wenn sie aufgrund der "Umständlichkeit" der Sprache ohne IDE kaum nutzbar ist. ...
    (de.comp.lang.java)
  • Re: javac vs Makefile problem ...
    ... In order to compile everything easily, I did a Makefile. ... You don't want 1 execution of javac for each .java file in your project; instead, what you want to do is invoke javac once on *all* .java files in your project -- all at one go. ...
    (comp.lang.java.programmer)
  • Java-Rauschen (war: Re: Getter & Setter)
    ... aber bei HTML ist nicht so sehr der Source als viel mehr das was im Browser angezeigt wird wichtig. ... Ich finde, eine interessantere Frage ist, warum man ueberhaupt gegen eine IDE ist. ... Nur hängt das mit einer bestimmten Menge an Code zusammen und die erreicht man bei Java schneller als bei zum Beispiel Ruby. ... Ich sehe es allerdings für eine textbasierte Programmiersprache als Nachteil an, wenn sie aufgrund der "Umständlichkeit" der Sprache ohne IDE kaum nutzbar ist. ...
    (de.comp.lang.java)
  • Re: Java-Rauschen (war: Re: Getter & Setter)
    ... Programmieren meinst, dass die IDE doch eh die ganze Zeit läuft, dann ... Eclipse ... Wenn du jetzt sagen würdest ich bin Java gegenüber Voreingenommen ... Groovy Java *braucht*, stört dich hingegen nicht. ...
    (de.comp.lang.java)