This happened to me many times when I started writing distributed Java applications.
Check your project build path (since you are using eclipse, right-click on the project folder, then choose Build Path> Configure Build Path). If any of the above paths exists custom * ie C:\User\daMachineMaster\Java\jre\bin or something else, it will not work on any other computer, because the application will always look for this path that will not exist on a different machine than daMachineMaster . You can use the shell to fix this problem, as it encapsulates all the necessary information in .exe, for example.
If this is not a problem, search the code for any links to your local directories. For instance,
String style = main.screens.ScreenFramework.class.getResource("C:\Users\Dwayne\Music\cool\DarkTheme.css");
Once you find these hard links, the solution changes them to relative links. Check How to determine relative path in java
In the above case, this would mean switching to something like:
String style = main.screens.ScreenFramework.class.getResource("DarkTheme.css").toExternalForm();
Also, as mentioned in other answers, check if other hava Java nodes are installed. I don't think they need the environment variables defined to run the runnable jar, but if you want to run the application in cmdline with something like java -jar yourapp.jar , you need to go to Windows Explorer (assuming you use windows ), right-click "Computer", then "Advanced System Settings"> "Environment Variables"> "Create ..."> "Variable Name" = JAVA_HOME; Variable Value = directory where java is installed> OK> Press PATH> Change ...> add JAVA_HOME \ bin to PATH> OK
source share