Jar has grey screen, not rendering displaying pixels etc - java

I'm trying to export my current project as a jar for testing purpose, but when ever I export it as an external jar, it works fine on my computer, but on my friends computer it just displays a grey screen.
My export settings are as followed:
Library Handling - Extract required libraries into generated JAR.
Any ideas on why it's not working?
What is meant to be displayed: http://i.stack.imgur.com/ArObt.png
These pixels are also moving across the screen horizontally in a constant loop, but for obvious reasons, you cannot see this(This is a picture xD).
This is from my computer by the way, but on another computer, its just a grey screen.
IDE: Eclipse
Both of us are using the same operating system.(Windows 7)
The program runs fine when launched in both run, and debug mode, no exceptions are thrown.
Jar runs fine on my computer.
Main Class: http://pastebin.com/fFcPsqnm

Related

Libgdx stuck generating an app

When I click on the downloaded libgdx file I select run with Java then the libgdx window pops up I check android (and tried to check desktop too) and leave the names default and some times I tried to change them and for extensions I leave it as default the only one checked is box 2D.
Its says in the little console below that it's generating an app in my desired path then its just stuck there for hours.
(I checked task manager and its not using almost any resources other than 60 mbs of ram)
This problem could possibly happen if the application cannot write into the destination folder you choose. So avoid making the destination folder inside the system32 folder or such.
Run the jar file from the command prompt to see the exception it generates which should explain the problem:
Hold down the Windows button and tap the 'r' key.
In the dialog type 'cmd' then enter.
Copy this text using ctrl-c, include all quotes. Adjust the file names to point to your Java VM runtime and your downloaded
gdx-setup.jar file: "C:\Program
Files\AdoptOpenJDK\jdk-8.0.222.10-hotspot\bin\java.exe" -jar "C:\Users\keith\Downloads\gdx-setup.jar"
Paste the text into the command prompt by pressing ctrl-insert (the zero key on the numpad). Alternatively, tap the top left icon,
then edit, then paste.
See what the specific exception is in the cmd console when the gdx setup program runs.

How do I undo zoom in in Eclipse?

I use MacOS High Siearra. My Eclipse IDE version is Oxygen 3(4.3.2). I have a big problem.
I accidentally shrunk my console area and text in the text field (using Command (-)) but now when I turn the screen back on, I close my tabs and when I reopen them the page opens in the smallest size. I have to fix it every time.
Also, I have not been able to make my console screen larger again if using a mouse. I'm glad you helped me. I also thought about reinstalling the IDE, but when I delete it from the application screen and install it again, I still have the same problem. I think I could not delete it with all the system folders. Please help me ... Thanks
These settings are stored in the workspace metadata which on mac is at location:
<your root path>/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings . Remove the intended setting from there and restart eclipse.
For example, my editor settings are in the file org.eclipse.ui.editors.prefs with content:
eclipse.preferences.version=1
lineNumberRuler=true
overviewRuler_migration=migrated_3.1
spellingEnabled=true

How to launch draw9patch and is it absolutely necessary to rescale pictures?

I read on another forum that to launch draw9pad from your console, you have to do java -jar draw9patch.jar from the command prompt once youre in sdk. I did that but i still cannot launch the file. Is this tool absolutely necessary for your pictures to scale on different screens? I know that eclipse has these drawable folders that scale your pictures to different dpis or is that not what they do?
Console output: http://imgur.com/YdGLHXr
File skd/tools :http://imgur.com/vOU647L
To answer the first question for a Mac OS or Linux user, simply type sh draw9patch to launch the editor. CommonsWare already answered the second question.
I read on another forum that to launch draw9pad from your console, you have to do java -jar draw9patch.jar from the command prompt once youre in sdk
Please use the draw9patch batch file or shell script found in the tools/ directory of your SDK installation.
I did that but i still cannot launch the file
First, that is because you did not type it in correctly, as you did not include the .jar extension.
Second, that JAR file is not in that directory. You can tell that by looking at the directory contents.
Instructions for running draw9patch can be found in the Android documentation.
Is this tool absolutely necessary for your pictures to scale on different screens?
Quoting the documentation:
A NinePatchDrawable graphic is a stretchable bitmap image, which Android will automatically resize to accommodate the contents of the View in which you have placed it as the background.
Scaling for different screens is not really the role of a nine-patch PNG file. Scaling for different content is. A nine-patch is used as the background for widgets like Button, EditText, and the like.

image icon not appearing outside eclipse

I made a chess game with a gui, using images for the pieces. It works perfectly when run in eclipse. However, I tried exporting the jar (from eclipse) and running it in cmd but none of the images appear (the game itself however works perfectly, i just have to guess where the pieces are).
I'm going to assume that there is an issue with the addresses of the images...
The problem is, I can't even seem to be able to open any of the files within the jar file to see what, if anything is going on.
In eclipse, all the images were in a package within the scr folder, and they are definitely within the jar.
Any advice?
If you want to load images within your jar file you will need to use the
Class.getResource(String) method.
For detailed instructions see the How to Use Icons section in the Java Tutorial.

Executable jar file won't run after doing some updates

I am working on Java project (A terraria like sandbox game) and I have come across something that I just don't understand. I have been exporting the project as .jar's as I go along to upload and share with my friends, but the last time I did this, the .jar won't run, but when I run it in eclipse, it runs fine. When I try to run the jar all it does is lose focus on the explorer window for a split second, then goes back. I have tried many things, like changing the main class, changing the META, and moving the files to specific packages, but nothing is working.
The project is 9 classes, so I won't paste all the code for it here, but the latest, non-working source code can be found here (http://www.mediafire.com/?fiw6wq73j7cff4t), the non-working jar here (http://www.mediafire.com/?bhjo162oh3hi2j9), and the working jar here (http://www.mediafire.com/?h918s8xpyxw4psr). If someone with more experience in java could please take a look at this it would be much appreciated.
One of the things I tried was not adding the JPanel (the game), and just leaving the splash screen, and the jar worked. This shows that it must be a problem in the coding somewhere.
Thanks for the time,
I.D.
Couldn't find message comes from your ReadMap class. So check which circumstance leads to this error. Most likely you did not add all classes or other files to your JAR, so file is not found. Check that all needed files are added to exported JAR in Eclipse export dialog. It's also a good idea to provide more debugging info (stacktrace is ok), especially when you are studying. BTW, cool game :)

Categories