Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Java

Journal karniv0re's Journal: Getting Java to Work at Work

Since the systems are kind of locked down here, I had to make some special scripts to get Java to compile here. I'm also using Ant for the first time. The first one is a "make" script.

make.bat

@echo off
REM set javac=C:\software\J2SDK1.5.0_04\bin\javac
REM set classpath=C:\Projects\cf_sched
REM $javac -classpath $classpath

set antpath=C:\software\ant\1.6.1\bin\

%antpath%ant.bat %1

The second one is a "run" script:

C:\software\J2SDK1.5.0_04\bin\java -classpath . %1

Then I was able to move all my GNU win32 software into my path, and I'm using Console.

So with all that said and done, this little Java code works:

C:\Projects\helloworld>cat Hello.java
// Hello.java
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello, world!");
}
}
C:\Projects\helloworld>make

C:\Projects\helloworld>set javac=C:\software\J2SDK1.5.0_04\bin\javac

C:\Projects\helloworld>set classpath=C:\Projects\cf_sched

C:\Projects\helloworld>set antpath=C:\software\ant\1.6.1\bin\

C:\Projects\helloworld>C:\software\ant\1.6.1\bin\ant.bat
Buildfile: build.xml

compile:

BUILD SUCCESSFUL
Total time: 0 seconds
C:\Projects\helloworld>run Hello
C:\Projects\helloworld>C:\software\J2SDK1.5.0_04\bin\java -classpath . Hello
Hello, world!

This discussion has been archived. No new comments can be posted.

Getting Java to Work at Work

Comments Filter:

If you can't get your work done in the first 24 hours, work nights.

Working...