Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3.5
- # in your case the python bin may be different!
- import os
- import sys
- def main():
- retVal = os.system("javac " + sys.argv[1].split('.')[0]+'.java')
- #if the javac is able to compile the code properly it wll return 0 else some other value!
- if(retVal is 0):
- print('[+] Compiled Successfully')
- print('[+] Executing Java Application')
- os.system("java " + sys.argv[1].split('.')[0])
- else:
- print('[-] Not Compiled Successfully')
- if(len(sys.argv) < 2):
- print("[-] need a .java file")
- print(":~$ javaPy ConsoleAppDemo.java")
- else:
- main()
Add Comment
Please, Sign In to add comment