Backtrack:  
 
showing posts tagged with 'java'
 
edited by on September 11th 2015, at 11:31

Here are the download links for the old Java SE 6, 7 and 8 installers. You can download both the JRE and JDK from these pages.

(*) For Java SE 6 and 7, you'll need to create a free Oracle account to download.

edited by on May 29th 2015, at 14:51

For some time now, installing/updating Java prompts you to install the Ask.com toolbar and search page. After installation, this is offered each time you install a new update of Java, which can be very annoying. A somewhat undocumented feature is that you can disable these offers from the Java Control Panel, preventing future updates from prompting you to install this thing.

  1. Open the Java Control Panel from the Windows Control Panel.
  2. Click the tab Advanced, scroll all the way to the bottom.
    There, under the Miscellaneous section, check Suppress sponsor offer when installing or updating Java.
edited by on May 29th 2015, at 13:24
The old method of disabling Java updates through the registry or GPO, mentioned in this article is no longer valid for Java 7 (1.7) and 8 (1.8), nor does it prevent the UAC prompt from appearing when the updater runs in the background. The method explained here is a better, more up-to-date solution to completely disabling Java updates from running, and includes the required registry change to stop the updater from running, preventing the UAC prompt from ever appearing.

Disabling Java update from control panel is not as straight forward as it seems to be. Java update can only be disabled with administrative rights, so you need to run the Java control panel elevated. Since you can't do this t  ...
edited by on May 28th 2015, at 12:10
You can compile for older versions of the JRE by setting the compiler target compliance level. This allows you to generate class files that are usable on older versions of the JRE as well as the current one.

From your IDE, you will be able to select the compliance level, but if you're compiling manually using javac, this can be done by setting the appropiate command line parameters: -source and -target.

For example, to compile for JRE 1.6, do this:

javac -source 1.6 -target 1.6 MyClass.java

A quick explanation:

-source sets the source compatibility to the specified version, and ensures that your code is usable on the specified JRE.

-target specifies the compliance level o  ...
edited by on May 28th 2015, at 11:39

For debugging purposes, I often prematurely abort a function by adding a return statement in the middle of it. With most compilers this works flawlessly, accept with Java...

The Java compiler bums out with an unreachable statement error, and won't allow you to compile a class until all code is reachable within a function.

Luckily, you can trick the compiler by adding an if-statement that's always true:

if (1==1) return;

This way, as the return is supposedly conditional, and the compiler doesn't consider the result of an if-statement, it is tricked into believing the following code is still reachable.

edited by on May 27th 2015, at 15:25

Preferred:

String x = JComboBox.getSelectedItem().toString();

or

String x = String.valueOf(JComboBox.getSelectedItem());

The second method protects against null values as well.

Avoid using casting:

String x = (String)JComboBox.getSelectedItem();

This would work fine if the item is indeed a string, but will fail if it can (also) be any other data type. To be safe, use either of the first two methods.

edited by on March 13th 2015, at 14:32

SwitchExplorer for Brocade FC switches no longer works properly on more recent versions of Java, because of security constraints. They can, however, be relaxed so you can still access your switches.

  1. Browse for the installation location for your JRE, and look for the folder lib/security (note: differentiate between 32 and 64-bit on Windows).
  2. Open the file java.security, and look for the line:
  3. jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
  4. Change the 1024 to 256, and save.

Note for Windows Vista and up: open the file elevated, or you won't be able to save it.

edited by on March 22nd 2013, at 14:42

Since a recent update of OSX, there's an issue with the Java-plugin not being active, even though Java Control Panel says it is. This is because in Safari the plugin is still set to inactive.

To resolve, surf with Safari to www.java.com/nl/download/testjava.jsp. You see the Java website with in the center the notification that the plugin is not active. Click on the text to re-active the plugin.

edited by on October 8th 2010, at 11:16
There is a problem with disabling Java Update when you're running Vista/2008/7 with UAC enabled. Trying to disable automatic updates through the control panel does not work as the setting will not "stick"

The problem is caused by an oversight of Sun. Running the configuration applet from Control Panel means it gets started as a unprivileged user, and the automatic update setting cannot be changed by such a user.

Rather than simply kick out jusched.exe from the registry (HKLM\SOFTWARE\Microsoft\CurrentVersion\Run, there's another way. Open an Explorer and manually find the control panel file (called javacpl.exe); default is this: C:\Program Files\Java\jre6\bin\javacpl.exe. Right-c  ...
 
showing posts tagged with 'java'