Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error in javah UsbInterfacePolicyfacePolicy #2

Open
devent opened this issue Nov 6, 2012 · 3 comments
Open

Build error in javah UsbInterfacePolicyfacePolicy #2

devent opened this issue Nov 6, 2012 · 3 comments

Comments

@devent
Copy link

devent commented Nov 6, 2012

Hello, I try to build it today but I get an error with javah: Error: Class javax.usb.UsbInterfacePolicy could not be found.

With is strange because the class is definitely there:

[javax-usb-libusb1] $ find . -name "UsbInterfacePolicy.java" ./javax.usb/src/main/java/javax/usb/UsbInterfacePolicy.java Tue Nov 06 08:42:12 (0) (master *) [javax-usb-libusb1] $ find . -name "UsbInterfacePolicy.class" ./javax.usb/target/classes/javax/usb/UsbInterfacePolicy.class

If I build javax.usb manually it's fine. So I think it is a path issue.
I cannot build javalibusb1 with have the same error.

Here is the build output:

[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ javalibusb1 --- [INFO] Compiling 11 source files to /home/devent-media/Sources/java/usb/javax-usb-libusb1/javalibusb1/target/classes [INFO] [INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-javah (default-nar-javah) @ javalibusb1 --- [INFO] Running /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/../bin/javah compiler on 4 classes... [ERROR] Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on [ERROR] Error: Class javax.usb.UsbInterfacePolicy could not be found. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] CPPTasks (parallel) ............................... SUCCESS [2.617s] [INFO] Maven NAR Plugin .................................. SUCCESS [4.428s] [INFO] Javalibusb1 ....................................... SUCCESS [0.079s] [INFO] Javalibusb1 :: javax.usb API implementation ....... SUCCESS [0.567s] [INFO] Javalibusb1 :: Implementation and JNI Wrapper ..... FAILURE [1.583s] [INFO] Javalibusb1 :: javax.usb utilities ................ SKIPPED [INFO] Javalibusb1 :: FTDI Driver ........................ SKIPPED [INFO] Javalibusb1 :: Misc USB tools ..................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.369s [INFO] Finished at: Tue Nov 06 08:34:28 CET 2012 [INFO] Final Memory: 28M/236M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-nar-plugin:2.1-SNAPSHOT:nar-javah (default-nar-javah) on project javalibusb1: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/../bin/javah failed with exit code 1 0x1 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :javalibusb1 Tue Nov 06 08:34:28 (0) (master)

javalibusb1 error:

Tue Nov 06 08:47:10 (0) (master *)
[javalibusb1] $ mvn install -Dlibusb.home=/home/devent-media/Sources/java/usb/javax-usb-libusb1/libusb-git -Dlibusb.cflags=-m64
/usr/lib/jvm/java
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
[WARNING] 
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: 'profile' (position: START_TAG seen ...</repositories>\n\n <profile>... @217:11)  @ /home/devent/.m2/settings.xml, line 217, column 11
[WARNING] 
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Javalibusb1 :: Implementation and JNI Wrapper 1.0.1-1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-validate (default-nar-validate) @ javalibusb1 ---
[INFO] Using AOL: amd64-Linux-gpp
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0-beta-1:enforce (default) @ javalibusb1 ---
[INFO] 
[INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-download (default-nar-download) @ javalibusb1 ---
[INFO] 
[INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-unpack (default-nar-unpack) @ javalibusb1 ---
[INFO] 
[INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-gnu-configure (default-nar-gnu-configure) @ javalibusb1 ---
[INFO] 
[INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-system-generate (default-nar-system-generate) @ javalibusb1 ---
[INFO] Generating /home/devent-media/Sources/java/usb/javax-usb-libusb1/javalibusb1/target/nar/nar-generated/javalibusb1/NarSystem.java
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ javalibusb1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-resources (default-nar-resources) @ javalibusb1 ---
[INFO] Copied 0 resources
[INFO] 
[INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-gnu-resources (default-nar-gnu-resources) @ javalibusb1 ---
[INFO] 
[INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-vcproj (default-nar-vcproj) @ javalibusb1 ---
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ javalibusb1 ---
[INFO] Compiling 1 source file to /home/devent-media/Sources/java/usb/javax-usb-libusb1/javalibusb1/target/classes
[INFO] 
[INFO] --- maven-nar-plugin:2.1-SNAPSHOT:nar-javah (default-nar-javah) @ javalibusb1 ---
[INFO] Running /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/../bin/javah compiler on 4 classes...
[ERROR] Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
[ERROR] Error: Class javax.usb.UsbInterfacePolicy could not be found.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.931s
[INFO] Finished at: Tue Nov 06 08:47:16 CET 2012
[INFO] Final Memory: 12M/149M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-nar-plugin:2.1-SNAPSHOT:nar-javah (default-nar-javah) on project javalibusb1: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/../bin/javah failed with exit code 1 0x1 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
@GeirARuud
Copy link

For a fast, local, fix:
In the pom.xml in the subproject javalibusb1, in <artifactId>maven-nar-plugin.., within the <configuration> block, add the following (with the hope that html tags are allowed):

      <javah>
        <classPaths>
            <classPath>/your-path-to-where-ever-your-files-are/javalibusb1/target/classes</classPath>
            <classPath>/your-path-to-where-ever-your-files-are/javax.usb/target/classes</classPath>
        </classPaths>
      </javah>

This should add the missing class(es) to the javah classpath (and hopefully include the one that actually is set, but removed when you explicitly set the classPaths like above).

Good luck!

Geir

@stefanct
Copy link

stefanct commented Jun 3, 2013

One can use the ${basedir} directive there, so my fix in stefanct@f5b24c0 should be generic.

@AbbottWC
Copy link

I am running into a similar problem trying to compile in Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants