



Before Java 1.6 was released to the public I used the Runtime class (found in java.lang) to call the java compiler (javac.exe) directly to compile a Java file from another Java application, the line of code that i used looks like this
But luckily for me Java 1.6 introduced a handy utility that makes it possible to compile a Java application within a Java application without making direct calls to an external application. To demonstrate that I wrote a HelloWorld Java file and a CompilerConsoleDemo class that compiles the HelloWorld java file.




*****************
Folder watcher demo
Do not distribute without the author(s) permission!
*****************
By: deAppel - www.engineeringserver.com
Contact: info [ @ ] engineeringserver.com
Version: 04/07/2008
*****************
Drag & drop your text files here: c:\demo\unprocessed\
There are no files waiting to be processed.
---
I wrote this demo just a moment ago after reading a topic here: http://www.javaprogrammingforums.com/new-java/70-folder-watching.html
Since i was bored i've coded it myself so here it is: http://engineeringserver.com/Software/FileProcessor_v1.rar
For those that want to parse their files their own way, just write your own ProcessFile that takes 2 arguments --> from / to and code whatever processing features you want in the ProcessFile.
For discussions, updates and what not visit the topic here: http://www.engineeringserver.com/t3hc0d3z/folder+watching-t1361.0.html


More Options ...
Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 