I'm developing a JavaFX 2.0 application using NetBeans, and I'm trying to deploy my application into a jar file.
I also need some external jars to be added. The build is made using ant which comes with Netbeans.
Finally the manifest file looks like this:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_25-b06 (Sun Microsystems Inc.)
Implementation-Vendor: iulia
Implementation-Title: NewVersionV3
Implementation-Version: 1.0
Main-Class: com/javafx/main/Main
JavaFX-Application-Class: myapp.view.NewVersionV3
JavaFX-Version: 2.0
Class-Path: lib/commons-codec-1.3.jar lib/commons-httpclient-3.1.jar l
ib/commons-logging-1.1.1.jar lib/httpclient-4.0.jar lib/log4j-1.2.16.
jar
Even having the Class-Path atribute there, generating the jar produces nothing
I found a console that tells me the problem :
Exception in thread "JavaFX-Launcher" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
Apparently it does not find the jars. I checked out and there are at the right location in dist/lib and my jar is in dist folder.
Anyone has an idea about this?
Thanks a lot,
Iulia
Related
I have a plain text java project in intellij, the project contains some java modules, one of the module is web application module, it will be generated a war file finally. All the modules build is manven.
After the maven build, the war file will be generated under /module/target/application-1.0.0.SNAPSHOT.war
Now what I have
1.Intellij community edition 2021.3.2
2.Smart tomcat 4.3.7
3.Tomcat 9.0.68
4.Maven 3.8.6
The target is
1.Add tomcat run/debug configuration which can include the War file
2.Before each launch of the war application, all modules should be built firstly
3.After the application startup, I can debug
Is this doable? if yes may I know how to configure this in intellij?
I am using gradle to generate a war file so that I can directly deploy the war in any remote tomcat server. I want to name the generated war as ROOT.war and after going through the docs I found a way of doing it as:
war.archiveName = "ROOT.war"
Its working fine but gradle generates the war as root.war (the name is in lowercase).
Can you tell me how to convert it into uppercase or is there any better way of doing it?
NOTE: I am using Gradle 2.2 on MAC OS X Yosemite
I'm having an issue with a custom hook I'm deploying in Liferay.
I've created both a hook and a theme using Liferay Plugins SDK 6.2.0
I create a .war (with Eclipse's built in Liferay -> SDK -> war command) for my theme, and deploy it onto my server running Liferay EE 6.2, which works fine.
However, I repeat the same process with my hook and I get this error:
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.UnsupportedClassVersionError: com/bofa/UserLoginImpl :
Unsupported major.minor version 51.0 (unable to load class com.bofa.UserLoginImpl)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassL
oader.java:2908)
I'm not sure if this could be a Java Compiler version error like I've read about, because my theme uses the same exact settings and works properly.
Any ideas?
Its because of different JDK at compile time and runtime, make sure you are using same JDK version to compile and run it.
It generally occurs if a higher JDK version is used to compile the java file and a lower JDK version is used at runtime
I have javaFX project, with which i'm working on Eclipse IDE. This is Maven project with using of Spring.
My goal is to make runable jar file (dekstop application) from this project.
If i export my application to jar file like any other java project, then i recieve this on error:
C:\eclipse\projjars>java -jar EqMan.jar
Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Can't load library: C:\eclipse\bin\glass.dll
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:276)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:122)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: C:\eclipse\bin\glass.dll
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:143)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:56)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31)
at com.sun.glass.ui.Application$1.run(Application.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:73)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:85)
at com.sun.glass.ui.win.WinApplication.<clinit>(WinApplication.java:33)
at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:20)
at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:17)
at com.sun.glass.ui.Application.Run(Application.java:108)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:266)
... 5 more
If i'm trying to make jar file with javafxpackager, i recieve this one error:
C:\eclipse\workspace\equification>javafxpackager -makeall -appclass ru.igs.ava.equification.EquificationFX -name "Equification" -width 800 -height 600
warning: [options] bootstrap class path not set in conjunction with -source 1.5
C:\eclipse\workspace\equification\src\main\java\ru\igs\ava\equification\EqConfigureRole.java:5: error: package org.springframework.context does not exist
import org.springframework.context.ApplicationContext;
C:\eclipse\workspace\equification\src\test\java\ru\igs\ava\equification\AppTest.java:11: error: cannot find symbol
extends TestCase
^
//and the same error for every class, which is added to my project as maven dependency.
So, how can i make runable jar file without converting my project to NetBeans project?
Seeing as you are using Maven for your builds, you can also use Maven to initiate the JavaFX packaging. To do this use the Maven antrun plugin to invoke the JavaFX ant tasks to generate a jar for your application with an embedded JavaFX launcher. Here is a sample maven pom to do this.
Your errors in running the javafx packager are due to not appropriately setting the classpath for the packager. An example of how to set the classpath for the javafx packager to package an application which relies on dependent lib jars is in this build script.
The unsatisfied link errors are because you are not including the required lib dll's in a ../bin directory relative to the runtime location of jfxrt.jar when you run your app. You also might not be correctly packaging your application with a JavaFX launcher (via executing the recommended javafx ant tasks or javafxpackager commands to generate your JavaFX application jar).
Update
For Maven based builds of JavaFX applications, you can now use a Maven JavaFX plugin.
Going from the suspicion that the underlying problem is due to an incompatibility between jfxrt.jar and the version of Java installed worked for me. The jfxrt.jar the application was using was compatible with jdk-7u71, yet the application was on a machine where JAVA_HOME was set to 7.0.05. So I installed jdk-7u71 on the problem machine and updated JAVA_HOME.
I am having a problem with an MONO application, I'm trying to compile the project (with MonoDevelop) so as to load the library run mscorlib.dll 4.0 instead of version 2.0. (I need System.Type.op_Equality method that is in version 4.0 but not in 2.0).
I've temporarily solved by making a link:
# cd /usr/lib/mono/2.0
# mv mscorlib.dll mscorlib.dll.bak
# ln ../4.0/mscorlib.dll mscorlib.dll
But of course this is not a valid solution.
Does anyone know how to MONO load mscorlib 4.0 instead of 2.0?
Thanks and sorry for my English
Finaly I found a solution for this problem:
https://bugs.launchpad.net/ubuntu/+source/gtk-sharp2/+bug/884035/comments/14
Simply modify the "app.config" file and change the content for this:
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0"/></startup></configuration>
Recompile the proyect and now work fine.
Right-click the project -> open the Build/General page and make sure Target Framework is Mono / .NET 4.0: