ChrisGeo
ChrisGeo

Reputation: 3907

JavaCV RedHat Linux 6.6 x64 NoClassDefFound: Could not initialize class org.bytedeco.javacpp.avutil

I want to run a simple .flv to .mp4 conversion on a Linux machine

Till now I was including the following dependencies and it was working fine on Ubuntu 12.x and CentOS

<dependency>
   <groupId>org.bytedeco.javacpp-presets</groupId>
   <artifactId>ffmpeg</artifactId>
   <version>2.7.1-1.0</version>
   <classifier>linux-x86_64</classifier>
</dependency>

Red Hat uname -a

x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

Red Hat lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 6.6 (Santiago)
Release:        6.6
Codename:       Santiago

CentOS uname -a

.x86_64 #1 SMP Tue Nov 3 19:10:07 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

However when trying it in RedHat Linux I get the following exceptions

Application startup failed

java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.avutil
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at org.bytedeco.javacpp.Loader.load(Loader.java:390)
    at org.bytedeco.javacpp.Loader.load(Loader.java:358)
    at org.bytedeco.javacpp.avformat$AVFormatContext.<clinit>(avformat.java:2539)
    at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:383)
    at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:377)
    at com.example.Application.convert(Application.java:53)
    at com.example.Application.run(Application.java:103)
    at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:674)
    at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:693)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:969)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:958)
    at com.example.Application.main(Application.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
    at java.lang.Thread.run(Thread.java:745)

I tried with 32 bit version:

<dependency>
   <groupId>org.bytedeco.javacpp-presets</groupId>
   <artifactId>ffmpeg</artifactId>
   <version>2.7.1-1.0</version>
   <classifier>linux-x86</classifier>
</dependency>

Same result.

Then I tried with simply

org.bytedeco javacv 1.0

and mvn package -Dplatform.dependencies=true so I got ALL dependencies.

Still the same. Any one have an idea what I'm doing wrong?

Upvotes: 1

Views: 991

Answers (1)

Chandra kant
Chandra kant

Reputation: 1574

avutil class is not available in the release you are using.
Use 2.8.1-1.1 version. <version>2.8.1-1.1</version> .

Upvotes: 2

Related Questions