我有一个项目正在运行,但是更新后我的gradle不支持mysql,并给我messege,您的gradle是旧版2.2,我需要做些什么才能将gradle升级到新版本?
在使用gradle和javafxport之间,我无法gradlew进入android或在桌面中运行它,而数据库始终是mysql始终向我发送消息,如以下堆栈跟踪
buildscript {
repositories {
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
}
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.3'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
dependencies {
compile 'mysql:mysql-connector-java:3.1.12'
}
//if (!hasProperty('Main')) {
// ext.mainClass = 'org.foo.Bar'
//}
mainClassName = 'main.Main'
jfxmobile {
android {
resDirectory = 'src/android/resources'
applicationPackage = 'org.javafxports.ensemble'
// compileSdkVersion = 27
resDirectory = 'src/android/resources'
// manifest = 'tmp/android/AndroidManifest.xml'
packagingOptions {
exclude 'META-INF/INDEX.LIST'
}
}
ios {
forceLinkClasses = [ 'com.gluonhq.**.*', 'com.mysql.**.*']
infoPList = file('src/ios/Default-Info.plist')
}
}
C:\Users\wjbr\Desktop\imene>gradlew run
:compileJava
:processResources
:classes
:compileDesktopJava UP-TO-DATE
:processDesktopResources UP-TO-DATE
:desktopClasses UP-TO-DATE
:run
??? 29, 2018 11:08:29 ? main.dbmobo getConnection
SEVERE: null
java.sql.SQLException: null, message from server: "Host 'LAPTOP-O0JMSNKL' is not allowed to connect to this MariaDB server"
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:991)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2558)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at main.dbmobo.getConnection(dbmobo.java:16)
at main.Main.start(Main.java:17)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
??? 29, 2018 11:08:29 ? main.dbmobo getConnection
SEVERE: null
java.sql.SQLException: null, message from server: "Host 'LAPTOP-O0JMSNKL' is not allowed to connect to this MariaDB server"
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:991)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2558)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at main.dbmobo.getConnection(dbmobo.java:16)
at controller.LoginController.<init>(LoginController.java:79)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at sun.reflect.misc.ReflectUtil.newInstance(ReflectUtil.java:51)
at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:927)
at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:971)
at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:220)
at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:744)
at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2707)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
at main.Mat(Main.java:18)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)