Engineeringserver.com

A community for computer science students & developers about software development, game development, game design, games, anime preview & reviews and more!


Java compiler API, compiling made easy

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 3.33 out of 5)
Loading ... Loading ...
1,889 views

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

JAVA:
  1. Runtime.getRuntime().exec("C:\\WINDOWS\\system32\\cmd.exe /c start javac " +  userDir + "\\test\\"+className + ".java");

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.

JAVA:
  1. public class HelloWorld {
  2. public static void main(String[] args){
  3. System.out.println("Hello World");
  4. }
  5. }

(more...)


Your Ad Here

Java paint demo 2

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
616 views

Another vid, no more flickering but there are still some problems with the actual drawing ("gaps" appear when moving the mouse too fast, but i'm working on it)

(more...)


Your Ad Here

[ java file copy ] Java folder watching

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
624 views

*****************
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


Your Ad Here