1

here is my case ...i have one xxxxxx.java file when compile and run the file i get output as yyyyyy.java file .....but i need yyyyyy.class file i.e is from xxxxxx.java file should automatically compile it output file and get yyyyyy.class...can this be done in java

thanks

0

2 Answers 2

1

Since Java 6, this can be done via the JavaCompiler API in javax.tools.

Sign up to request clarification or add additional context in comments.

Comments

1

Use the interface from the tools package. There are enough examples on the web, one is here: http://www.java2s.com/Code/Java/JDK-6/CompilingfromMemory.htm

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.