Home arrow static arrow Java Programming [Archive] - writing an java IDE with java
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - writing an java IDE with java
This topic has 9 replies on 1 page.

Posts:39
Registered: 8/11/03
writing an java IDE with java  
Jun 23, 2004 2:38 AM



 
Hello everyone!

I have the task of writing a simple java IDE with java on the win32 platform . I want to call "javac.exe" to compile the code and "java.exe" to run it. How can I do it? Should I use JNI? If so, how can I do it? Or are there other better methods? Thank u!!!
 

Posts:6,147
Registered: 11/9/00
Re: writing an java IDE with java  
Jun 23, 2004 3:00 AM (reply 1 of 9)



 
You can run external tasks, like a compilation, with the Runtime.getRuntime().exec() method.

Programs under test can be run either the same way, or more directly in the same virtual machine, bacically by loading the main class and invoking "main". To do this you would create a URLClassLoader which accesses the classpath on which the program under test is to run.

I suspect there are ways of running the compiler the same way.
 

Posts:39
Registered: 8/11/03
Re: writing an java IDE with java  
Jun 23, 2004 3:14 AM (reply 2 of 9)



 
thank u. i'll try it.
 

Posts:1,695
Registered: 1/13/04
Re: writing an java IDE with java  
Jun 23, 2004 3:28 AM (reply 3 of 9)



 
You can also use the Java tools, which makes your app platform-independent:
//...import com.sun.tools.javac.Main;//...    public static boolean compileSource(String filename) {      String[] javac_args = { filename };      int result = Main.compile(javac_args);      return (result == 0);   }//

Hope this helped,
regards.
 

Posts:2,578
Registered: 01/11/02
Re: writing an java IDE with java  
Jun 23, 2004 3:43 AM (reply 4 of 9)



 
Java versions of all the tools are available in the Tools.jar in the lib directory of the sdk
 

Posts:2,578
Registered: 01/11/02
Re: writing an java IDE with java  
Jun 23, 2004 3:45 AM (reply 5 of 9)



 
ie the tools used in Franck's suggestion
 

Posts:5,627
Registered: 3/22/04
Re: writing an java IDE with java  
Jun 23, 2004 4:06 AM (reply 6 of 9)



 
Also, if you look in Vorobiev's Swing book (manning.com), you'll find the code for such an editor.
 

Posts:39
Registered: 8/11/03
Re: writing an java IDE with java  
Jun 23, 2004 5:14 AM (reply 7 of 9)



 
I guess you really helped me much, thank u guys.
 

Posts:5,965
Registered: 5/17/03
Re: writing an java IDE with java  
Jun 23, 2004 5:24 AM (reply 8 of 9)



 
I don't want to discourage you but both Eclipse and NetBeans are open source examples of what you want to do, except they're not simple of course -:)
 

Posts:39
Registered: 8/11/03
Re: writing an java IDE with java  
Jun 23, 2004 6:25 AM (reply 9 of 9)



 
I know it.
And I'm a eclipse user too. I have to work out this 'cause it's a home work :-(
have fun! :-)
 
This topic has 9 replies on 1 page.