using perl script to compile java

From: David (david_jerus_1969_at_voila.fr)
Date: 02/29/04

  • Next message: Gunnar Hjalmarsson: "Re: EOL Anchor under Windows"
    Date: 29 Feb 2004 06:12:52 -0800
    
    

    Hi everybody,
    I'm trying to do a small perl sript to compile a basic java code.
    This is what I've done so far. the name of Java code is "hello.java",
    and the name of the perl script is "compile". This is how I run it
    :compile Hello.java
    There are 2 steps, the first one is to create the hello.class which is
    normally done, by writing javac hello.java.
    the script is :
    'javac $argv[0]';

    The second step is to do java hello, using the Hello.class created,
    and this what I did in my script to do that :
    opendir (DH, "."); # open the local directory
    foreach $file (@list) {
    if ($file =~ /class$/) {
    $trouve = $file;
    last;} # search the Hello. class.
    }
    @test = split(/.class/,$trouve,2); # separate Hello from Hello.class
    and run it
    'java $test[0]'; #this line of code is supposed to do the step 2 but
    it doesn't work.

    any idea is welcomed.

    Cheers;

    David


  • Next message: Gunnar Hjalmarsson: "Re: EOL Anchor under Windows"

    Relevant Pages

    • Re: embedding jython in CPython...
      ... > I've read that it is possible to compile jython to native code using ... > My goal is to be able to script Java code using Jython - but with the ...
      (comp.lang.python)
    • Re: Java For Mac/Linux
      ... An alternative way may be to compile your java code with gcj (gnu ... compiler) but I don't know if it exists for mac. ... often an .exe wrapper that invokes the JVM is used. ...
      (comp.lang.java.programmer)
    • problems with basic "Hello World" program
      ... I have a basic program where I compile the java code and then run it. ... class HelloWorld ...
      (comp.lang.java.help)
    • help! how can a compiled mfile read structured data from a mfile
      ... I have a set of m-files, A.m, B.m and C.m. ... by another program in Java code. ... So I compiled the m-files into C++ dll file ... compile A.m and B.m into D.dll and call C.m at runtime, ...
      (comp.soft-sys.matlab)
    • java jsp compiliing issue
      ... java code that I want to add to the site. ... I would like to use this class as a set utility funcitons. ... I also tried specifying the test ... All I want to do is compile this thing so that I can use the utility ...
      (comp.lang.java.programmer)