java - How to use external Jars in javafxports-Application -


i write javafx andoid application in netbeans javafxports , gradle. added dependencies gradel, dont know how add jars project or use in app-code. . .

do know how can it? tried searching www hours ...

ok tried dont ...

i did said netbeans still says: package io.netty.bootstrap not exist

i created folder unter src/android/ called libs , add jar there ...

here dependencies:

dependencies {     compile filetree(dir: 'src/android/libs', include: ['*.jar'])     compile files('src/android/libs/netty-all-4.0.29.final.jar') } 

final solution:

  1. you have add: compile 'io.netty:netty-all:4.0.24.final' build.gradle file. (example netty jar-libary)
  2. i copy libary (netty) folder called "libs" in main folder not in sry , on. create folder if not exist
  3. write code , see, import works.

thank josé pereda time , final solution!

based on edited question, these few suggestions working dependencies on javafxports project.

dependencies , build.gradle file

according this, default dependency configurations compile , runtime supported, , jfxmobile plugin adds configurations each supported platform androidcompile or desktopruntime.

to access third party dependencies, given repository should added:

repositories {      jcenter()    }     dependencies {     compile 'groupid:artifactid:version' } 

since jcenter() superset of 'mavencentral()`, can use maven dependency in form of:

<dependency>     <groupid>org.glassfish</groupid>     <artifactid>javax.json</artifactid>     <version>1.0.4</version> </dependency> 

as compile 'groupid:artifactid:version'. in case:

dependencies {     compile 'org.glassfish:javax.json:1.0.4' } 

local files

accesing local jars can done using files:

dependencies {      compile files('lib/my-jar.jar')  } 

having my-jar.jar @ lib folder inside project, outside src folder.

if want add several jars:

dependencies {      compile filetree(dir: 'lib', include: ['*.jar'])  } 

gluon plugin netbeans

after change in build.gradle file, necessary reload project, new changes taken account, , new dependencies retrieved.

under projects view, right click on project root , select reload project.

check dependencies folders, should contain jars included in build.

since there several of these folders, can see instance compile android includes android.jarand jfxdvk-8u60-b3.jar. compile main should contain jars defined compile.

samples

these projects build.gradle contains dependencies, way start javafxports.


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -