edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
714 stars 110 forks source link

Class not found exception #93

Open aabhaanjan opened 7 years ago

aabhaanjan commented 7 years ago

Hi In my system it is working fine when trying to install in other system it is throwing error: Error during create application phase java.lang.ClassNotFoundException: com.lab.Main at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at fxlauncher.Launcher.createApplication(Launcher.java:179) at fxlauncher.Launcher.lambda$start$0(Launcher.java:85) at java.lang.Thread.run(Thread.java:745)

aabhaanjan commented 7 years ago

No base JDK. Package will use system JRE. No base JDK. Package will use system JRE. Creating app bundle: BurnAndTurn in C:\Users\project1\target\installer\bundles Result application bundle: C:\Users\project1\target\installer\bundles Installer (.exe) saved to: C:\Users\project1\target\installer\bundles Bundler MSI Installer skipped because of a configuration problem: Can not find WiX tools (light.exe, candle.exe).
Advice to fix: Download WiX 3.0 or later from http://wix.sf.net and add it to the PATH. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS

aabhaanjan commented 7 years ago

is this an error of jdk ?

edvin commented 7 years ago

The javapackager tool is telling you that you need to install WiX or InnoSetup before you're able to create installers :)

Actually, I think you might have Inno Setup installed, and hence have an exe installer already in C:\Users\project1\target\installer\bundles. You don't necessarily need the MSI installer.

To be able to debug the run time error you need to provide either the generated installer or your project configuration.

aabhaanjan commented 7 years ago
4.0.0 Sample Sample 4.0.7 ${project.name} com.abc.Main ${project.build.directory}/app ${project.build.directory}/installer http://www.abc.com/game/ false src/main/deploy/package/windows/Sample.ico src org.apache.maven.plugins maven-jar-plugin 2.6 ${app.dir} maven-compiler-plugin 3.3 ${basedir}/src/main/resources/sfs 1.8 1.8 com.abc.Main com.zenjava javafx-maven-plugin 8.1.2 Sample Sample Sample-sample example com.abc.Main true EXE src/main/deploy/package/windows/Sample.ico src/main/deploy/package/windows/Sample.png true src/main/deploy/package/windows org.apache.maven.plugins maven-dependency-plugin 2.10 copy-dependencies package copy-dependencies ${app.dir} false false true org.codehaus.mojo exec-maven-plugin 1.4.0 create-manifest package java fxlauncher.CreateManifest ${app.url} ${app.mainClass} ${app.dir} --cache-dir=${app.cacheDir} --accept-downgrade=${app.acceptDowngrade} ${app.parameters} embed-manifest-in-launcher package exec jar ${app.dir} uf fxlauncher-1.0.13.jar app.xml installer install exec javapackager -deploy -native -outdir ${app.installerdir} -outfile ${app.filename} -srcdir ${app.dir} -srcfiles fxlauncher-1.0.13.jar -appclass fxlauncher.Launcher -name ${project.name} -title ${project.name} -vendor ${app.vendor} ${app.version} ${project.groupId}.${project.artifactId} -Bicon=Sample.ico -BSetupIconFile=src\main\deploy\package\windows\Sample-setup-icon.bmp -BshortcutHint=true deploy-app exec scp -r ${app.dir}/. ${app.deploy.target} smartfox sfs2x-api 1.0.1 compile smartfox sfs2x-client-core 1.0.1 compile smartfox slf4j-api 1.0.1 smartfox slf4j-simple 1.0.1 org.slf4j slf4j-api 1.6.4 compile org.slf4j jcl-over-slf4j 1.6.4 runtime org.slf4j slf4j-log4j12 1.6.4 runtime log4j log4j 1.2.16 smartfox netty 1.0.1 javafx jfxrt ${java.version} system ${java.home}/lib/ext/jfxrt.jar fxlauncher fxlauncher 1.0.13
edvin commented 7 years ago

I can't see anything immediately wrong here, can you also provide the installer?

FranAguiar commented 6 years ago

I'm getting this error too. productionApp jar and fxlauncher.jar are in the same folder (target/app) with al the dependencies

Error during Create Application phase java.lang.ClassNotFoundException: com.project.clients.production.ProductionApp at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at fxlauncher.AbstractLauncher.createApplicationEnvironment(AbstractLauncher.java:170) at fxlauncher.Launcher.lambda$start$0(Launcher.java:149) at java.lang.Thread.run(Thread.java:748)

jperezcu commented 6 years ago

Hi @edvin, I'm getting the same error as well using the OSX installer found here: https://tix.innova-red.net/downloads/assets/tix-time-client-0.1.0-SNAPSHOT.dmg

java.lang.ClassNotFoundException: com.github.tix_measurements.time.client.Main at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at fxlauncher.AbstractLauncher.createApplicationEnvironment(AbstractLauncher.java:170) at fxlauncher.Launcher.lambda$start$0(Launcher.java:149) at java.lang.Thread.run(Thread.java:745) Here's the repo: tix-time-client

edvin commented 6 years ago

Before this error you should have gotten another error which will most probably show you what the real issue is :) Can you post the complete output if you run the app from the command line?

jperezcu commented 6 years ago

I forgot to add, this error appears inside an error window only when executing the .app file, NOT when executing .jar file (using the jar works perfectly). And the error window starts with "Error during Create Application phase".

edvin commented 6 years ago

I don't have a Mac atm, but I cloned the tix-time-client repo and did gradle generateNativeInstaller and then ran the installer exe. It installed the app perfectly and started it without issues. Is the issue only Mac specific perhaps?

jperezcu commented 6 years ago

Yes, it's definitely Mac specific.