-1

Below line is not executing prog.java simply it is executing javac. How can i execute prog.java here?

  shell_exec('C:\Program Files (x86)\Java\jdk1.6.0_05\bin\javac C:\Apache24\htdocs\uploads\prog.java ');
Benjamin
  • 2,257
  • 1
  • 15
  • 24
Abhi_Sharma
  • 51
  • 1
  • 4

1 Answers1

0

Assuming shell_exec is your method for doing system calls AND you have prog.class in the dir specified try:

shell_exec('C:\Program Files (x86)\Java\jdk1.6.0_05\bin\java C:\Apache24\htdocs\uploads\prog'
  • Thank you for replying , but still sir , i am getting this as an output on browser. Usage: java [-options] class [args...] (to execute a class) or java -jar [-options] jarfile [args...] (to execute a jar file) where options include: -hotspot to select the "hotspot" VM If present, the option to select the VM must be first. The default VM is -hotspot. -cp -classpath set search path for application classes and resources -D= set a system property -verbose – Abhi_Sharma Apr 19 '14 at 05:54