Tuesday, August 7, 2007

Running a simple Java program on Windows

let's say you have:

// Toto.java
package com.mydomain.MyTest;
public class Toto
{
public static void main (String[] args)
{
System.out.println("hello");
}
}


then, you can create a BuildRun.bat like this:

REM BuildRun.bat
javac Toto.java
copy Toto.class com\mydomain\MyTest\
java.exe com.ltu.MyJNITest.Toto

To get directly the execution shell file that you need to run, you can get it from Eclipse:
http://stackoverflow.com/questions/2502518/eclipse-export-running-configuration
.

No comments: