如何创建包装jedit源代码的netbeans 7.3项目? [英] How can I create a netbeans 7.3 project wrapping the jedit source code?

查看:127
本文介绍了如何创建包装jedit源代码的netbeans 7.3项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这是一个简单的问题,因为已经有关于此此处的Wiki主题. 本节.但是,该Wiki已过期.这里有一个关于Stackoverflow的先前问题,该问题仅引用了这些现在过时的Wiki主题. netbeans Wiki必须用于某些较旧版本的NetBeans UI,并且我正在使用NetBeans 7.3.

I thought this is an easy question because there's already a wiki topic about this here especially this section. however the wiki is out of date. A prior question exists here on Stackoverflow that only has a reference to these now out of date wiki topics. The netbeans wiki must be for some older version of NetBeans UI, and I'm using NetBeans 7.3.

如果我尝试使用7.3中的现存源选项,则它假定您已经不能拥有build.xml,因此它告诉您不能继续进行操作:

If I try to use the existing sources option in 7.3 it assumes that you cannot have a build.xml already, and so it tells you you cannot proceed:

出于说明目的,可能有助于显示jedit源代码文件夹的某些结构. 我同时拥有最新的jEdit源代码和5.0稳定源代码.项目布局大致如下:

For illustration purposes it may help to show some structure of jedit source code folders. I have both the latest jEdit source code and the 5.0 stable source code. The project layout is roughly like this:

      + jedit
        |
        +- org
        |
        +- net
        |
        +- test
        |
        +- de
        |
        ....

我已经找到了root build.xml所在的文件夹,但是我无法按照wiki的说明进行操作,因为似乎不再有这样的project-with-existing-ant-build-script选项.

I have located the folder where the root build.xml is located, but I cannot follow the wiki instructions because there does not appear to be such a project-with-existing-ant-build-script option anymore.

现在我们尝试自由格式"选项...它也不起作用...

到目前为止,自由格式项目都可以使用,它可以让您创建一个netbeans项目,但是对目录的扫描会导致netbeans内部完全混乱.一系列路径为."的文件夹.添加,重复的."的5个副本.文件夹,以及项目树视图中的5个重复的源包"条目.这可能与自由格式的第二个问题有关,该问题将不会生成和运行jEdit,但是会死于一条奇怪的错误消息,当我尝试在NetBeans外部构建时不会发生此错误消息:

The free-form project works in so far is that it lets you create a netbeans project, but the scan of the directory results in a complete mess inside netbeans. A series of folders with path "." are added, 5 copies of a duplicate "." folder, and 5 duplicate "Source Packages" entries in the project tree view. This may be related to the second problem with free-form which is that it will not build and run jEdit, but dies with a strange error message that does not happen when I try to build outside netbeans:

项目窗格中的混乱情况使我无法浏览或查看源代码结构:

The mess in the project pane, leaves me unable to navigate or see the source structure:

它没有建立:

Processing /Users/admin/NetBeansProjects/jedit/trunk/build/test/merged-reports/TESTS-TestSuites.xml to /var/folders/59/mc8gzxfn1b98j389rkz4zjsc0000gs/T/null666107982
Loading stylesheet jar:file:/Applications/NetBeans/NetBeans%207.3.app/Contents/Resources/NetBeans/java/ant/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
: Error! The first argument to the non-static Java function 'replace' is not a valid object reference.
: Error! Cannot convert data-type 'void' to 'reference'.
: Fatal Error! Could not compile stylesheet
Failed to process /Users/admin/NetBeansProjects/jedit/trunk/build/test/merged-reports/TESTS-TestSuites.xml
/Users/admin/NetBeansProjects/jedit/trunk/build.xml:442: Errors while applying transformations: Fatal error during transformation
BUILD FAILED (total time: 35 seconds)

所以我放弃了自由格式项目,因为它没有构建.

So I gave up on the free-form project because it doesn't build.

现在,在删除build文件夹和build.xml都不起作用的情况下,开始使用现有资源打开项目...

如果我想导入项目源代码(只是java,因为删除了它,所以没有build.xml),我被卡在这里:

If I want to import project sourcecode (just the java, no build.xml because I deleted it), I get stuck here:

我试图做什么?我试图将源文件夹添加为orgdenet下的目录(请参阅我在问题中放在上面的源树).但是,netbeans会自动向上遍历到我的源代码的ROOT文件夹.

What did I try to do? I tried to add the source folders, as directories under org, de and net (see the source tree I put above in my question). However netbeans automatically traverses upwards to the ROOT folder of my source code.

我无法选择除根目录以外的任何其他文件夹,因为选择该文件夹下的文件夹会导致Netbeans总是无奈地一直向上移动文件夹层次结构,直到到达所需的位置为止.不会有任何不同.

这反过来导致netbeans抱怨它决定对我做某事,这是因为它使用jedit作为根源文件夹,因此它不能包含jedit/test.我没有选择(但是jedit/下有许多文件夹)导致netbeans做任何不同的事情.它坚持要遍历子目录,以提供帮助.我开始认为,现实世界中的Java用户可能会以netbeans无法处理的方式来组织其源代码.

This in turn leads to netbeans complaining about something it decided to do to me, which is that it can't include jedit/test because it's using jedit as the root source folder. Nothing I select (however many folders below jedit/) results in netbeans doing anything differently. It insists on traversing back through subdirectories in an effort to be helpful. I am beginning to think that the real world users of java may organize their source code in a way that netbeans cannot handle.

其他信息

  • 使用jedit的源使用默认的build.xml容器从ant外壳构建,只要您具有最新版本的ant,就可以正常工作.重新安装ant修复了我的命令行构建功能.

  • Building from the shell with ant against the default build.xml shipping with the sources of jedit works fine, as long as you have a modern version of ant. Reinstalling ant fixed my command line build abilities.

我发现必须先从apache网站安装最新的ant版本,然后Mac OS X才能在命令行上构建jEdit 5.0.我的netbeans应用程序捆绑包中的ant版本可能有所不同.

I found that I had to install the latest ant version from the apache website before my Mac OS X box would build jEdit 5.0 at the command line. The ant version inside my netbeans app bundle may be different.

我正在使用OS X 10.8,并安装了hava Java 1.5、1.6和1.7,目前针对Java 1.6进行构建.

I am using OS X 10.8 and hava Java 1.5, 1.6, and 1.7 installed, currently building against java 1.6.

在我看来,Netbeans轻松而优雅地打开了Maven项目,这又是由于Maven项目通常遵循标准的Java目录布局.在基于命名和布局标准的Netbeans可以理解的程度上,基于Ant的构建也可以很好地导入,但是jEdit似乎是Netbeans无法以其当前形式干净处理的东西.

It seems to me that Netbeans opens Maven projects with aplomb and grace and this in turn is due to Maven projects generally following standard java directory layouts. Ant-based builds also seem to import nicely to the extent that naming and layout standards are intelligible to Netbeans, but jEdit appears to be something that Netbeans can't cleanly handle in its current form.

推荐答案

下面的URL包含在NetBeans 7.3中设置和编译jEdit 5.0.0源代码的说明.

The URL below has instructions to setup and compile jEdit 5.0.0 source in NetBeans 7.3.

http://www. areaofthoughts.com/2013/01/compiling-running-jedit-5-in-netbeans-73.html

摘要:

    必须下载
  • jsr305-2.0.1.jar依赖项并将其手动添加到netbeans库"选项卡,否则javax.annotation.Nonnulljavax.annotation.Nullable将无法解决.

  • jsr305-2.0.1.jar dependency must be downloaded and added manually to netbeans Libraries tab or else javax.annotation.Nonnull and javax.annotation.Nullable will not resolve.

将jedit源代码解压到将成为netbeans项目的文件夹下的子目录1级是 essential .

Unpacking the jedit source code to a subdirectory 1 level underneath the folder that will be the netbeans project is essential.

这篇关于如何创建包装jedit源代码的netbeans 7.3项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆