Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- use strict;
- if(!defined $ARGV[0] || $ARGV[0] eq ''){
- print "Useage: $0 sourse_file target_dir\n";exit 0;
- }elsif(!defined $ARGV[1] || $ARGV[1] eq ''){
- print "Useage: $0 sourse_file target_dir\n";exit 0;
- }elsif($ARGV[0] !~/.+\/(.+)\.java/){
- print "Useage: $0 sourse_file target_dir\n";
- print "And sourse_file must be a .java file\n";
- exit 0;
- }elsif($ARGV[1] !~/\/$/){
- print "Useage: $0 sourse_file target_dir\n";
- print "And target_dir must have '/' at the end.\n";
- exit 0;
- }
- my ($file_java,$dir) = ($ARGV[0],$ARGV[1]);
- system 'javac -classpath /opt/hadoop/lab.jar -d '.$dir.' '.$file_java;
- $file_java =~/.+\/(.+)\.java/;
- my $file_name;
- $file_name = $1;
- system 'jar -cvf '.$dir.$file_name.'.jar '.$dir.$file_name.'*.class';
- system 'rm '.$dir.$file_name.'*.class';
Add Comment
Please, Sign In to add comment