简体   繁体   English

将Jasmin集成到Ant和Eclipse中

[英]Integrating Jasmin into Ant and Eclipse

I'm working on a Java project for which I need a very specific testing code, which I create in Jasmin, the JVM assembly. 我正在一个Java项目中,我需要一个非常特定的测试代码,这些代码是我在JVM程序集Jasmin中创建的。 The project is built with Ant and has a nice directory structure, namely: 该项目是使用Ant构建的,具有很好的目录结构,即:

root
  /src
    /classes
    /tests
  /build
    /classes
    /tests

The tailor-made Jasmin source file is in the src/tests directory, together with the JUnit Java files. 量身定制的Jasmin源文件和JUnit Java文件位于src / tests目录中。 All of these get built with Ant (I use the simple "java" Ant task to run the Jasmin compiler on the source file), they're put into respective directories inside the /build folder, and Ant then runs the JUnit tasks. 所有这些都是使用Ant构建的(我使用简单的“ java” Ant任务在源文件上运行Jasmin编译器),将它们放入/ build文件夹中的相应目录中,然后Ant运行JUnit任务。 All of this works fine... 所有这些都很好...

Until I introduced the single Jasmin-generated class, Eclipse worked perfectly with the project. 在我介绍Jasmin生成的单个类之前,Eclipse与该项目完美协作。 The problem is that Eclipse doesn't see the new .class file. 问题在于Eclipse无法看到新的.class文件。 The Build Path contains src/classes and src/tests as source folders, and /build as an output folder. 构建路径包含src / classes和src / tests作为源文件夹,并包含/ build作为输出文件夹。 Yet it doesn't seem to be able to find the class generated by Jasmin, so there are hundreds of "ClassX unresolved" problems and it really makes developing quite painful. 但是,它似乎无法找到Jasmin生成的类,因此存在成百上千个“未解决的ClassX”问题,这确实使开发工作非常痛苦。

Does anyone have an idea how to force Eclipse to see this class? 有谁知道如何迫使Eclipse看到此类?

一个简单的解决方案是将Jasmin类编译到一个单独的类文件夹中,然后将该文件夹添加到Eclipse的构建路径中:Project Properties / Java Build Path / Libraries / Add Class Folder ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM