Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I can't solve your problems but nice tags.
Google is your friend (not really though) use it. -
check the Java version in Ubuntu, my guess you are using OpenJDK and not Oracle Java
-
Cyanite84918y@elgringo
It was OpenJDK. I didn't know there was a difference. That's just what came pre-loaded. -
31415098yIf you are using JavaFX, you have to install the OpenJFX package. For some reason it isn't part of the normal OpenJDK installation.
-
Cyanite84918y@elgringo
How does one propperly install jre/jdk.. I tried tar, but it seems that I have to cd into the install dir to run the files. -
31415098y@Cyanite I'm quite sure that you don't need to use the Oracle JDK. There are only minor differences and even those are mostly licensing and some other stuff only relevant in certain business environments. However, you aren't doing yourself any favours by manually installing some Java version and circumventing the whole package management system.
If you really think you need the Oracle JDK (which I'm quite sure you don't), you can use the oracle-java8-installer package (there is a PPA for it). -
Cyanite84918y@3141
All I know is when i used the Oracle jre, the jar ran perfectly. Unlike with then Openjre even know they were both Java8 -
Cyanite84918y@3141
It couldn't find my main class within my jar.
With javac, any import that contained a * didn't work.
And yes. Most of my code is JavaFX -
Cyanite84918y@3141
The jar works fine with the oracle java.
I use:
jar -cfve build.jar application.TestApp application/ src/ *.css *.jpg
Edit:
application/ contains the *.class files for two files of my application package.
src/ just contains the *.java files, and a LICENSE file. -
:facepalm:. native depenendencies for the fail. make sure you have the required .so files.
-
31415098y@Cyanite I just tried to replicate the exact problem. Apparently, not having openjfx installed, causes a jar using JavaFX to fail with the error message: "Error: Could not find or load main class"
I assume that the problem isn't the finding part, but rather the loading (since your main class tries to import JavaFX, but it doesn't exist on your system).
So just install openjfx and it will work. -
@Cyanite missing natives is not the problem. take a look at the build logs for clues.
-
Cyanite84918y@3141
Well, if it's this complicated for me trying to run the damn jar.. Then end users are also going to have problems. So I need a work around. -
Cyanite84918y@magicMirror
I know exactly what the problem is thanks to @3141, I just need a permanent solution so this doesn't bother end users. -
31415098y@Cyanite The easiest way would be to ship a bundled JRE. JavaFX offers a relatively easy way to do this via the javafx-maven-plugin. The build-native goal creates native packages (e.g. deb or rpm, or simply a folder containing the app) that can be run without having to install any Java related stuff on the target system.
It does require some configuration effort, but I think something like this would be the best solution to your problem. -
31415098y@Dav13 That was about manually installing the Oracle JDK. There is literally no connection to any Windows environment variables.
-
Cyanite84918y@Dav13 @3141
Adding the folder to path is actually what I might end up doing, but I'd rather find an alternative. -
Cyanite84918y@jpichardo
It's too early for that, also this is a private build. These commands that I actually use to compile and test my code.
Though I will do that with public builds. -
@Cyanite good, anyhow, you should consider using maven it'll ease the build, testing and deploying phase :);
-
Cyanite84918y@jpichardo
For building? No. I use command scripts. Personal preference. I can change them on the fly very simply. I like to work from the terminal and having my scripts ready is a huge help. -
@Cyanite good, well the you should check this: https://maven.apache.org/guides/...
It explains how to configure a basic Maven project and in the Pom you can configure the steps, which is really useful -
doomsday7618yIf you're using Ubuntu (or any distro with apt) you can use the apt made by webupd8team.
They download the jdk from Oracle server itself, and I've read the installer source, no funny business :)
This link is old, but it works. Just recently installed it on zesty based GNOME
http://webupd8.org/2012/09/...
Gud luck :)
Related Rants
I have Java 8 installed on both Windows10 and Ubuntu16
My (basic) app compiles fine in windows with javac, and when put into a jar works perfectly. But when cloned to my Ubuntu, javac fails to compile, and the jar fails to run.
undefined
i should of gone to law school
i'm a failure
java
build errors
is mcdonalds still hireing?
what is going on