GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Troubleshooting Troubleshooting
Raphaël de Courville edited this page
Please use the forum for general troubleshooting questions, especially if it's something like Processing not starting up properly, or sketches simply not running.
If you don't find your problem, submit a new issue here. When you're creating a new issue, there is an “issue template” which includes some information we need to help you find the problem. Please fill this out as best you can! We want to help, and these are the first questions will need to ask. For best results:
If your code worked in version 3 and has a problem in version 4, read the Changes in 4.0 page. If it worked in a previous version of Processing 4, read the revisions page for clues about what might be different.
Windows Defender says this software is a virus! Microsoft Windows says it's a trojan! It's not. Unfortunately, each Processing release seems to eventually get tagged as a virus or trojan on Windows. This seems to be getting more frequent over time. I'd be more concerned if Microsoft agreed with itself on what virus or trojan the software included, but it's different each time. Windows Defender sometimes delays the Processing download (at the end of the download, your browser may keep spinning), or even breaks the software before it can be used, by removing files that are incorrectly marked as “malicious.” We’ve started submitting each release to Microsoft so that it won't flag us in error. If you see an error like this, make sure you're using the latest version of the software. But then again, why trust me? I'm just an anonymous voice inside a wiki document. I could be the virus itself! Or am I a trojan? If you don't trust me (especially now), please submit the software download to Microsoft yourself using this link. They will investigate and hopefully remove the detection. Longer-term we probably need to sign the software but we haven’t had time to figure it all out, and it may also cost us a few hundred dollars a year. Also note that Processing releases for Windows are done inside a Virtual Machine that are only used for Processing releases. No other connections to the internet, so it’d be super hard to get a virus in there. It's not impossible, but over 280 releases, 21 years, and tens of millions of downloads, we’ve had just one—in maybe 2002?—that was infected (and that was before the virtual machine was an option, and I couldn't afford a dedicated Windows machine for testing). It was removed and replaced within a couple hours.
Since Processing 4.4.3, sketches automatically use See above or read Pixel Density Changes. See above or read Pixel Density Changes. If you get an Depending on your OS and available RAM, there are limits on how much memory you can ask for. Use this preference with caution, because if you set the memory too high, programs will no longer run in Processing. When you hit run, you'll get error messages. If this message appears after you hit Run, then you're trying to use more memory than the machine has installed: The following messages mean that you're trying to use more memory than the Operating System allows (regardless of how much RAM you have): The maximum is often around 50% more than the actual memory that your machine has. Unfortunately, memory limitations set an upper bound that is outside our control. If you're having trouble creating very large images for this reason, you might look into the PDF or DXF libraries that are included with Processing, or the contributed Illustrator or SVG vector export libraries that can be found on the libraries page as another alternative for creating large format images. Memory is like any constraint found in other media, you simply need to be more clever about how to deal with the limitations. To check the amount of memory that's used so far, or how much is available, use Java's Runtime object: // The amount of memory allocated so far (usually the -Xms setting) long allocated = Runtime.getRuntime().totalMemory(); // Free memory out of the amount allocated (value above minus used) long free = Runtime.getRuntime().freeMemory(); // The maximum amount of memory that can eventually be consumed // by this application. This is the value set by the Preferences // dialog box to increase the memory settings for an application. long maximum = Runtime.getRuntime().maxMemory(); Comparing a string (quoted text) is different in Processing (Java) than it is in JavaScript, ActionScript, and some other languages, which can be confusing. For instance, while this might make sense: String[] lines = loadStrings("sometext.txt"); for (int i = 0; i < lines.length; i++) { if (lines[i] == "hello") { println("hello found on line: " + i); // you'll never see this } } You'll never see the message, even if "hello" is in the list. This is because a String is an Object in Java, comparing them with == will only compare whether the two things are pointing at the same memory, not their actual contents. Instead, use equals() or one of the other String methods (eg. String[] lines = loadStrings("sometext.txt"); for (int i = 0; i < lines.length; i++) { if (lines[i].equals("hello")) { println("hello found on line: " + i); // happiness } } "But if I write the following code, it works!" final String HELLO = "Hello"; String hello = "Hello"; println(hello == HELLO); That's because Java compiler detects two identical constant strings, so it groups them together, and their references (memory location) are identical. If you write instead: final String HELLO = "Hello"; String hell = "Hell"; println(hell + "o" == HELLO); It no longer works. Same for strings coming from an external source (file, Internet, etc.). In Java, the result of dividing two integers will always be another integer: While somewhat confusing at first (especially if you've been using JavaScript or other languages that don't work this way), this is later useful for more advanced programming (or simply to confuse you further when you go back to those languages). To get fractions, use a float a = 2.0; float b = 5.0; float result = a / b; // 'result' will be 0.4 It is not enough to just divide two integers and set them to a float: float y = 2 / 5; In this case, integer 2 is divided by 5, which is zero, and then zero is assigned to a float. The number doesn't become a float until the left hand side of the = sign. On the other hand, this: float y = 2.0 / 5; will work just fine. In this case, Java sees that 2.0 is a float, so it also converts the 5 to a float so that they can be divided, which makes it identical to: float y = 2.0 / 5.0; and because floats are being used on the right hand side, the result will be a float, even before it gets to the left hand side.
The reason this doesn't work is that This means that If you're hitting this problem, here are possible workarounds:
In macOS Sierra, Apple changed how key repeat works. In most applications, when you press and hold a key for some characters, a small menu will pop up that shows possible alternates. For instance, holding You'll probably need to restart Processing after using this command. (It's necessary to use Note that this will turn off the menu for your other applications as well, so if you need to bring back the old behavior, do the following: Typing a semicolon after an if (somethingAmazing == true); { println("This happens, whether or not something is amazing."); } The semicolon immediately following If you write a couple lines of code with no If your code has a For instance, without a draw(), this code will stop after the void setup() { size(400, 400); } void keyPressed() { println(key); // this will never happen } This code can be fixed by adding: void draw() { } This means that you're using code that was compiled for a later version of Java than is supported by Processing. Processing supports Java 17, so make sure that you're using Java 17 class file format for any Libraries or other code that you're trying to use with Processing. Any code that accesses the Why doesn't saveFrame (or saveStrings or saveBytes) write things to the data folder? All The simple solution, if you need to save and then load data, is to explicitly include Objects with alpha (lines or shapes with an alpha fill or stroke, images with alpha, all fonts) are displayed in P3D and OpenGL based on their drawing order. This creates some unfortunate effects like making things opaque if they're drawn out of order with objects above or beneath them. This is simply how 3D rendering works. To improve appearance, add Names of sketches cannot start with a number, or have spaces inside. This is mostly because of a restriction on the naming of Java classes. Also: don't name your sketch the same thing as a library or other class that's used in your sketch. For instance, your sketch shouldn't be named “Server” if you've imported the net library, because it already has a class called Mind the capitalization of built-in functions. If a method or variable name is two words, usually the first word is lowercase and the first letter of the second word will be capitalized. For instance: If you have a function called Processing sketches have a default However, 60 is only the “maximum” frame rate, if a lot of computation is in the code, the sketch will attempt to use as much CPU as is available. You can see the current println(frameRate); Because printing to the console a lot can slow down the frame rate that you're trying to check, you can also set it to only print on every 10th frame by using if (frameCount % 10 == 0) { println(frameRate); } If you're using coordinates larger than (or near) 16,384 (2^15) or 32,768 (2^16), you're likely to have problems. This is because of low-level hardware and operating system limits, and not something that we can control. In fact, it's so out of our control that it's difficult when you'll hit these issues: what operating systems, what hardware, etc. Bottom line: just use smaller numbers. Processing is designed to make it easy to create quick sketches: short code that might be one or three or even six tabs. It's not great—or intended to be used—for larger projects. This is an intentional design decision to keep it simple for the vast majority of users. We're not trying to create a full-featured IDE. If you have more then 3-5 tabs, you're better off with IntelliJ or Eclipse or even Visual Studio Code. While the PDE may still work with a dozen tabs, we just don't recommend it, and have no plans to make changes to support it further.
The system clock sometimes goes weird, especially when using According to someone on the site: “This bug has been fixed in bug no 4500388 and one requires a PRODUCT FLAG to use the fix. This flag and fix are available in 1.3.1_4, 1.4.0_2, 1.4.1 and 1.4.2. But for Java to actually use the fix, open your Java Plug-in Control Panel in the section 'Java Runtime Parameters' just enter: Hard crashes that write In some cases, we can find things that might trigger the problem, but it's more likely than not to be a Java problem, or something inside native code from a library that's included.
The following message (or messages like it) on startup: This is just a Java issue, but doesn't seem to affect anything. Clone this wiki locally |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |