开发者

How to compile java source from custom ide [closed]

开发者 https://www.devze.com 2023-03-28 10:35 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so开发者_StackOverflow中文版 that it can be reopened, visit the help center. Closed 11 years ago.

I am making an interpreted language with java......and am also making an IDE for it. I want to know how to compile java source from my IDE and have it run on a console. I have created a simple console window. But how do i compile java source from my simple IDE and route its output to my console window?

The Interpreted language is interpreted by an interpreter i created and it then creates a java source that needs to be compiled.


You can use the JavaCompiler interface from the JDK. Read the linked documentation to get an elaborate example of how to use it.

As to running the resulting code, you use the Tool class.

In general: Check out the javax.tools package in the JVM.


Assuming you get the syntax right, you would want to compile it using javac . Now choosing which implementation of the JVM to use is another issue as not everything lines up so "nicely"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号