开发者

How to compile java source from custom ide [closed]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜