I've created JCodeModel that contains all classes I want to generate. The thing is that I want to generate bytecode (.class files) and a jar but not the sources. Is there an elegant way to do it without generating the .java files and later compiling thme into a .class files and a jar?
generation of java bytecode using JCodeModel
449 Views Asked by DiSol At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in CODE-GENERATION
- Using Simulink Coder - atomic change of multidimensional parameters (matrix, vector)
- Generate C++ style code using LLVM
- Generate variable definition code from runtime data structure
- Hibernate Domain Object Generation
- Rails Generator Pass an Array of Arguments
- generation of java bytecode using JCodeModel
- How can I use Scala macros to create an object?
- Is there way to format code with line-breaks and indentation produced by ExpressionToCode
- JavaPoet Add Generic Parameter
- Visual Studio code generation - Use uppercase type names
- xtext generator how to prevent file override
- Openjpa generate entities from table skips one column
- Using TM_SELECTED_TEXT in my custom snippets
- Compiling java class from non-java file
- Dynamically update .csproj during Visual Studio build
Related Questions in JCODEMODEL
- Add import using code model
- generation of java bytecode using JCodeModel
- How to generate static initialization block with jcodeModel
- How to generate comment inside a method with JCodeModel
- Save Jcodemodel Object after exit
- Use JCodeModel to generate toString() method
- Code Model Import for Class with Embedded Enum
- How to get generic type "T" of class when reused in method
- auto-initialize Fields created by JCodeModel
- JAXB, XJC: Generating field to Class Outline
- Using JCodeModel, SonarLint reports classes from "sun.*" packages should not be used
- How to generate a generic method with JCodeModel?
- Cannot find exception classes in CodeModel in XJC plugin
- How do I force-enclose a CodeModel expression in brackets?
- JCodeModel - How to chain invoke methods
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can consider one of several java byte code generators: Any Java Bytecode Generation Guide?
But if you prefer to deal with JCodeModel lib you have an option to keep intermediate java code in memory as temporary stage. Here is sequence of hints:
(1) Here is an example how to get java source text in memory: Compile dynamically generated class at runtime w/o writing to File
(2) Then you can use similar thing to keep compiled byte code in memory again: https://github.com/trung/InMemoryJavaCompiler/blob/master/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java
(3) Finally to create jar-file from byte code stored in memory just do thing similar to: How to use JarOutputStream to create a JAR file?
PS: Last stage could be done as stream writing directly to database (BLOB field or so).