在OS X上编译TuxGuitar,javac无法找到包

时间:2014-11-15 21:11:45

标签: java ant makefile classpath javac

我试图在OS X上编译TuxGuitar(吉他指法编辑器)。我已经检查了TuxGuitar存储库中的代码:

svn checkout svn://svn.code.sf.net/p/tuxguitar/code/trunk tuxguitar-code

现在,当我运行make并使用ant时,似乎javac无法在项目源代码树中找到Java包。我已将make的完整输出放在http://people.kth.se/~albertwi/tuxg-make-error;它非常庞大,所以我无法将其全部放在代码块中。

我假设这是一个半平凡的类路径问题,但我无法告诉如何修改构建配置。在make输出的第307行及以后,在" some_file.java的形式上存在错误/警告,因为some_file.class不存在",我不会知道这会带来什么:

[javac] org/herac/tuxguitar/app/TGMain.java added as org/herac/tuxguitar/app/TGMain.class doesn't exist.
[javac] org/herac/tuxguitar/app/TuxGuitar.java added as org/herac/tuxguitar/app/TuxGuitar.class doesn't exist.
[javac] org/herac/tuxguitar/app/action/TGActionAccessInterceptor.java added as org/herac/tuxguitar/app/action/TGActionAccessInterceptor.class doesn't exist.
...

在第715行以及之后的某些类路径中包含,但似乎并非所有必需的文件夹都附加在此处(TuxGuitar源代码树包含TuxGuitar表单上的文件夹 - 某些程序组件 / src / org / herac / tuxguitar,例如TuxGuitar-ascii / src / org和TuxGuitar-fluidsynth / src / org,我相信包含在这里,但它们不是&#39 ; T):

[javac] Compilation arguments:
[javac] '-d'
[javac] '/Users/awifstrand/src/tuxg/tuxguitar-code/TuxGuitar/build'
[javac] '-classpath'
[javac] '/Users/awifstrand/src/tuxg/tuxguitar-code/TuxGuitar/build:/Users/awifstrand/src/tuxg/tuxguitar-code/TuxGuitar:/opt/local/share/java/apache-ant/lib/ant-launcher.jar:/opt/local/share/java/apache-ant/lib/ant-antlr.jar:/opt/local/share/java/apache-ant/lib/ant-apache-bcel.jar:/opt/local/share/java/apache-ant/lib/ant-apache-bsf.jar:/opt/local/share/java/apache-ant/lib/ant-apache-log4j.jar:/opt/local/share/java/apache-ant/lib/ant-apache-oro.jar:/opt/local/share/java/apache-ant/lib/ant-apache-regexp.jar:/opt/local/share/java/apache-ant/lib/ant-apache-resolver.jar:/opt/local/share/java/apache-ant/lib/ant-apache-xalan2.jar:/opt/local/share/java/apache-ant/lib/ant-commons-logging.jar:/opt/local/share/java/apache-ant/lib/ant-commons-net.jar:/opt/local/share/java/apache-ant/lib/ant-jai.jar:/opt/local/share/java/apache-ant/lib/ant-javamail.jar:/opt/local/share/java/apache-ant/lib/ant-jdepend.jar:/opt/local/share/java/apache-ant/lib/ant-jmf.jar:/opt/local/share/java/apache-ant/lib/ant-jsch.jar:/opt/local/share/java/apache-ant/lib/ant-junit.jar:/opt/local/share/java/apache-ant/lib/ant-junit4.jar:/opt/local/share/java/apache-ant/lib/ant-netrexx.jar:/opt/local/share/java/apache-ant/lib/ant-swing.jar:/opt/local/share/java/apache-ant/lib/ant-testutil.jar:/opt/local/share/java/apache-ant/lib/ant.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/lib/tools.jar'
[javac] '-sourcepath'
[javac] '/Users/awifstrand/src/tuxg/tuxguitar-code/TuxGuitar/src'
...

然后在第1143行和之后我得到"包org.herac.tuxguitar。某些包不存在"错误:

[javac] /Users/awifstrand/src/tuxg/tuxguitar-code/TuxGuitar/src/org/herac/tuxguitar/app/TuxGuitar.java:27: error: package org.herac.tuxguitar.action does not exist
[javac] import org.herac.tuxguitar.action.TGActionManager;
[javac]                                  ^
[javac] /Users/awifstrand/src/tuxg/tuxguitar-code/TuxGuitar/src/org/herac/tuxguitar/app/TuxGuitar.java:68: error: package org.herac.tuxguitar.document does not exist
[javac] import org.herac.tuxguitar.document.TGDocumentManager;
[javac]                                    ^
[javac] /Users/awifstrand/src/tuxg/tuxguitar-code/TuxGuitar/src/org/herac/tuxguitar/app/TuxGuitar.java:69: error: package org.herac.tuxguitar.event does not exist
[javac] import org.herac.tuxguitar.event.TGEvent;
[javac]                                 ^
...

我不熟悉makeant。我如何以及在何处进行配置更改,javac可以找到包?

问题是如此复杂,我应该向TuxGuitar开发人员询问这个问题吗?

更新:我尝试使用https://sourceforge.net/p/tuxguitar/discussion/522984/thread/3843b30b/#1ce9建议的另一种编译方式,所以我转到文件夹build-scripts / tuxguitar-macosx-cocoa-64并运行{{1但是后来我得到了与SWT相关的错误......基本上(http://people.kth.se/~albertwi/tuxg-mvn-error处的完整输出):

mvn clean package -Dnative-modules=true

我在/ Library / Java / Extensions中有swt.jar的最新版本(4.4),所以它应该在类路径上。

1 个答案:

答案 0 :(得分:2)

我遇到了同样的麻烦,看起来Makefile坏了,因为它使用了ant而不是maven。 以下是我所做的步骤(感谢我的同事Clément,当我使用穿孔卡时,它出生于java):

$svn checkout svn://svn.code.sf.net/p/tuxguitar/code/trunk tuxguitar-code
$sudo apt-get install maven
$cd tuxguitar-code
$uname -a
Linux acacia 3.16-3-amd64 #1 SMP Debian 3.16.5-1 (2014-10-10) x86_64 GNU/Linux
$cd build-scripts/tuxguitar-linux-x86_64
$rehash
$mvn clean package
$cd target
$cd tuxguitar-1.3-SNAPSHOT-linux-x86_64
$./tuxguitar.sh

这对我在3台不同的计算机上都有效,但这些都是基于debian的。 希望这有帮助