Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Java
  4. how can i compile c/c++ code with java?

how can i compile c/c++ code with java?

Scheduled Pinned Locked Moved Java
questionc++javaperformance
2 Posts 2 Posters 15 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    David Wong RZ
    wrote on last edited by
    #1

    I want to use java for compiling c/c++ code,and the compiled infomation should be caught,e.g overflow...Is there a way to carry out this?I used getRuntime().exec("gcc .c -o .exe"),on this condition there was no information from compiling time. How can i use java to control that one executable program(e.g .exe) not to access the files out of this folder/directory,and assure the program not to performance anything in high-risk command like system("reboot") or while(1) fork();Is that possible for java? If c/c++ could be better to do this,welcome as well. thanks so much!!!:confused::confused::confused::cool:

    no cross no crown.

    F 1 Reply Last reply
    0
    • D David Wong RZ

      I want to use java for compiling c/c++ code,and the compiled infomation should be caught,e.g overflow...Is there a way to carry out this?I used getRuntime().exec("gcc .c -o .exe"),on this condition there was no information from compiling time. How can i use java to control that one executable program(e.g .exe) not to access the files out of this folder/directory,and assure the program not to performance anything in high-risk command like system("reboot") or while(1) fork();Is that possible for java? If c/c++ could be better to do this,welcome as well. thanks so much!!!:confused::confused::confused::cool:

      no cross no crown.

      F Offline
      F Offline
      Filip van der Meeren
      wrote on last edited by
      #2

      Why would you use java to compile C/C++ ?¡ And for what you want to do (full control over the compilation) you should resort to something like make and predefine each and every step in the process, and calling the makefile in your exec(...)

      Don't you also love the code?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups