-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open the same JAR in Window, Mac and Linux Platforms <title updated from original> #84
Comments
Hi QJ, Did not come across this issue myself but I think this stackoverflow post would help you streamline your debugging! https://stackoverflow.com/questions/2861592/possible-to-run-jar-file-on-any-os |
Thank you for the response. I will wait for my team member to try out the suggestions provided. Thank you. |
Is the Java installed Java from Oracle or OpenJDK? |
hi , i believe should be from Oracle site |
This comment has been minimized.
This comment has been minimized.
Hi, can you type in java -version into your terminal and tell me what you see |
If you are still facing the same issue, I suggest that you check what Java version (8,11, OpenJDK, Java SE) you packaged and built the JAR file with. If you had followed the build.gradle file dependencies from any of the reference repos (e,g addressbook), the packaging and building of the JavaFX should be correct because it installs the libraries for all the platforms. If you used the gradle plugin, it should be the same case. |
Try including this if you have not in your build.gradle file sourceCompatibility = JavaVersion.VERSION_11 |
The issue for projects with a GUI utilizing java FX based implementation require this to be added in the dependency under the build.gradle to make it work on other Operating Systems. Created on Win and tested it on a Mac and it works. |
Goes on to prove most of you didn't bother to read #65 😜 |
oops! totally forgot about this issue. Thanks prof! |
reopening this a PSA |
Hi we have tried the solution posted in #65 but our team is still having issues running the jar on each other's OS. A jar file built on Windows only works on a windows machine, likewise for OSx. We tried building a jar on both OSes and running it on each other's OS. This is the error output when running the jars. It seems that only the first line of error output is any different. This is our java versions: This is our build.gradle file.
|
Hi you have to remove the javafx {...} portion! This helped mine!
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Dana Poon <[email protected]>
Sent: Thursday, November 7, 2019 3:31:23 PM
To: nusCS2113-AY1920S1/forum <[email protected]>
Cc: Sai Ganesh Suresh <[email protected]>; Comment <[email protected]>
Subject: Re: [nusCS2113-AY1920S1/forum] Open the same JAR in Window, Mac and Linux Platforms <title updated from original> (#84)
Hi we have tried the solution posted in #65<#65> but our team is still having issues running the jar on each other's OS. A jar file built on Windows only works on a windows machine, likewise for OSx. We tried building a jar on both OSes and running it on each other's OS. This is the error output when running the jars.
It seems that only the first line of error output is any different.
Built on OSx, run in Windows:
[image]<https://user-images.githubusercontent.com/42791813/68368415-fcf47480-0172-11ea-9179-a35e272f5782.png>
Built on Windows, run in OSx:
[WhatsApp Image 2019-11-07 at 3 23 58 PM (1)]<https://user-images.githubusercontent.com/42791813/68368375-e5b58700-0172-11ea-9215-5e27824c4863.jpeg>
This is our java versions:
Windows: [image] <https://user-images.githubusercontent.com/42791813/68366675-e0563d80-016e-11ea-8230-c4917324e466.png>
OSx: [WhatsApp Image 2019-11-07 at 3 23 58 PM] <https://user-images.githubusercontent.com/42791813/68368309-bdc62380-0172-11ea-8746-9760217669bb.jpeg>
This is our build.gradle file.
plugins {
id 'java'
id 'application'
id 'checkstyle'
id 'com.github.johnrengelman.shadow' version '5.1.0'
id 'org.openjfx.javafxplugin' version '0.0.7'
}
checkstyle {
toolVersion ='8.23'
}
shadowJar {
archiveBaseName = "eggventory"
archiveVersion = "1.3.1"
archiveClassifier = null
archiveAppendix = null
}
group 'seedu.eggventory'
version '0.1.0'
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.5.0'
String javaFxVersion = '11'
implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux'
}
javafx {
version = "11.0.2"
modules = [ 'javafx.controls', 'javafx.fxml' ]
}
test {
useJUnitPlatform()
}
repositories {
mavenCentral()
}
application {
// Change this to your main class.
mainClassName = "eggventory.Eggventory"
}
run {
standardInput = System.in
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#84?email_source=notifications&email_token=AKFWHRR37BLYG5PROQAUONTQSO74XA5CNFSM4JHISFR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDLPRJQ#issuecomment-550959270>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKFWHRUIQ5JMCTZO2J2OWKDQSO74XANCNFSM4JHISFRQ>.
|
That worked. Thanks! |
Hi all , this happened to my group after one of our only window user tried to open jar file today. Did anybody face the same problem before ? It will be great to share your experience here while i continue searching for an answer now.
The text was updated successfully, but these errors were encountered: