Load an applet with specified older JRE version instead of latest installed - applet

I wish to load my applet with JRE version 1.6.0_14. I have installed updates 14, 17, 24 and 35. I am using <object> tag with classid to load version with update 14.
in this case, the applet get loaded with update 35 and then again with update 14. on the java console on update 35 no error noticed and on Java console of update 1.6.0_14 we see the following error.
java.lang.ClassNotFoundException: sun/net/www/protocol/http/NTLMAuthenticationCallback
How to avoid higher version JRE to be used? And how to avoid the class not found error?

It is a serious security risk to run with a lower version of the JRE. Not when you run your own applet, cause you trust your own code. But others ought to refuse running it. You, yourself, should be wary when browsing the net with a browser that does not have the latest version of the JRE installed.
The JRE installer installs the Java Plugin into your browser and one single version of the Plug-in will always be started, independent of the Java version you request. The Plugin will then run the applet in the JRE that is specified in the classid of your object tag. The versions available to the Plug-in are configurable in the Java Control Panel.
This leaves the question of why your application won't run with a recent version of java 1.6. The Plugin got a big overhaul in 1.6.0_something into what's called the Next Generation Plug-in. Maybe that is what is giving you trouble. You can indicate that you wish to use the old Plug-in on your machine in the Java Control Panel on the advanced tab. ("Enable the Next Generation Java Plug-in (requires a Browser restart"). I'd think it's interesting to know if disabling the Next Generation Plug-in solves your issue.

Related

Can't add Java Applications in Eclipse Run Configurations after upgrading to 4.7

My application isn't running correctly with Java 9. In order to debug it, I upgraded to Eclipse 4.7 (oxygen) since Neon doesn't have Java 9 support, and applied the Java 9 support patch.
After doing so, eclipse was failing to load any of my pre-existing Java Applications. Thinking it might be a version difference thing, I deleted them, to try re-adding. But when I click the "New" button to add a configuration, nothing happens.
If I double-click "Java Application," I get the following error:
An error has occurred. See error log for more details.
tried to access method org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.getTabViewer()Lorg/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer; from class org.eclipse.jdt.internal.debug.ui.launcher.LocalJavaApplicationTabGroup
I am able to add configurations for other types of applications (Java Applet, Eclipse Application) so it seems only to be an issue with Java Applications.
I also tried a fresh workspace, but that has the same issue. How can I fix this?
This is kind of a duplicate but since I experienced the issue and have seen a few others post about it, I'll post my answer of how I fixed it here.
If you go here: https://marketplace.eclipse.org/content/java-9-support-beta-oxygen/
You need to follow the step about updating Eclipse 4.7 from the link that ends in 4.7-U-builds. When you go to Install New Software and select Eclipse SDK, click Next until you get to the Install Remediation Page, and make sure that you are selecting the second option that says something like "update my installation to be compatible with the items being installed" instead of the option that says "keep my installation the same and modify the items being installed to be compatible."
The first time I installed Java 9 updates, I did it the latter way and ran into this problem. Now that I've gone back and chosen the former, I am able to add Java Application Run Configurations again.
Hope this helps.
Eclipse Oxygen.1a (4.7.1a) Release
Update as of 11 October,2017 - You shall upgrade to the latest eclipse package Eclipse Oxygen.1a (4.7.1a) which is marked as released and supports Java 9.

Can't get Eclipse Kepler CheckStyle plugin to work

I am downloading it from here: http://eclipse-cs.sourceforge.net/update/
- Checkstyle version 6.2.0.20150
My eclipse build is: 4.3.2
I have tried downloading it from both the marketplace and the website above, though both ways do not create a "checkstyle" link in the preferences window.
Anyone have any idea what's going on here?
I've also encountered the mentioned problem. But the reason is simple. In the release notes we can read:
Please note that as of this version Java 7 is the minimum runtime
environment supported. This requires you to run Eclipse on a Java 7
(or newer) JVM in order to use this plugin version.
Checkstyle since version 6.2.0 (released in January 2015) needs Java 7 as the minimum runtime environment.
So in order to run Eclipse on a Java 7, you can for example edit eclipse.ini file and add at the beginning something like:
-vm
C:\Program Files\Java\jdk1.7.0_75\bin\javaw.exe
Your exact path to javaw.exe could be different, of course. Alternatively make JDK 7 (or newer) as the default JVM for your system.

Javafxpackager: how do you set the "base JDK"?

When I run javafxpackager, I get the following warning/info:
No base JDK. Package will use system JRE.
It's not clear from the docs for Deploying JavaFX Applications how one would specify an alternative JDK. There isn't an option for it, that I can see (maybe I'm blind). Is it a system property?
Thanks.
There is an old Oracle blog which mentions this. Don't know if it is still applicable or relevant to your case or not though:
Self-Contained Applications: Select Java Runtime to bundle
Packager tools in 7u6 assume current JDK (based on java.home property)
is the source for embedded runtime. This is useful simplification for
many scenarios but there are cases where ability to specify what to
embed explicitly is handy. For example IDE may be using fixed JDK to
build the project and this is not the version you want to bundle into
your application.
To make it more flexible we now allow to specify location of base JDK
explicitly. It is optional and if you do not specify it then current
JDK will be used (i.e. this change is fully backward compatible).
New 'basedir' attribute was added to tag. Its value is
location of JDK to be used. It is ok to point to either JRE inside the
JDK or JDK top level folder. However, it must be JDK and not JRE as we
need other JDK tools for proper packaging and it must be recent
version of JDK that is bundled with JavaFX (i.e. Java 7 update 6 or
later).
Here are examples ( is part of task):
<fx:platform basedir="${java.home}"/>
<fx:platform basedir="c:\tools\jdk7"/>
Hint: this feature enables you to use packaging tools from JDK 7
update 10 (and benefit from bug fixes and other features described
below) to create application package with bundled FCS version of JRE 7
update 6.
When run with the parameter -Bruntime:
javapackager.exe -Bruntime="c:\Program Files\Java\jdk1.8.0_76\jre\" ...
you get the following info:
Using base JDK at: c:\Program Files\Java\jdk1.8.0_76\jre
In case it helps anyone, I wanted to use javapackager to bundle the 32-bit Java 8 JRE. I was running into issues because the JDK was the 64-bit Java 8 JDK. I was able to solve my issue by setting JAVA_HOME to the 32-bit JRE.
I have just solved same problem:
NetBeans ID - Tools - NetBeans Platform Manager - "Sources" tab
button Add ZIP/Folder
(there were no sources set so I set it and "No base JDK. Package will use system JRE."
disappeared)

eclipse crashing with intellisense

Eclipese crashes on one (and only it appears) intellensense.
typing "Display.getW" (towards the Display.GetWidth() function) as I type W eclipse reproduceably crashes. Trying random other functions and classes yield no problems.
Any ideas as to what this might be?
Eclipse Info: Eclipse Java EE IDE for Web Developers.
Build id: 20100218-1602
Eclipse Galileo
Edit: Using windowsXP
The only bugs related to a crash on auto-completion all mention Linux platform and an issue with xulrunner library.
See for instance bug 236724:
You don't need to download an older version of xulrunner since the problem is merely that the 64bit version of the library is being loaded rather than the 32bit library.
To rectify this, just add the following line to your eclipse.ini file which points to the 32bit version of the xulrunner library:
-Dorg.eclipse.swt.browser.XULRunnerPath=<path_to_32bit_xulrunner_lib>
On RHEL5 for example, the path would be /usr/lib/xulrunner-1.9.
So you would in this case either need an older version of xulrunner, or fixing its path.
On Windows, on the other hand, that may be a good opportunity to fill in a new bug report.
Update February 2012, Raedwald mentions in the comments:
The relevant Eclipse FAQ "Can I specify which XULRunner installation gets used?"
This can also fix the problem if you provide as the XULRunnerPath a path-name that does not point to an xulrunner library directory.
What happens is that Eclipse instead falls back to using an internal renderer.
I believe this is the only solution if your O/S (such as RedHat 5.8) upgrades you to a FireFox version that uses xulrunner-2 but does not provide webkitgtk.
This, and related problems, are caused by incompatibilities between Eclipse and xulrunner, which is a component of Fire Fox. I came across this problem today, after updating Fire Fox on my RHEL 5 development computer.
The "intellisense" (content assist) feature, and other features of Eclipse, are a rendering of HTML. Eclipse tries to hand-off this rendering work to a system component. If your web browser is Fire Fox, Eclipse traditionally uses xulrunner, which is intimately associated with Fire Fox. It does so by calling a C API through a native library. However, that API is subject to change by the Mozilla developers, and different versions of xulrunner have had incompatible APIs. In particular, Eclipse can not use "xulrunner 2", which is the version in recent versions of Fire Fox.
Newer versions of Eclipse try not to use xulrunner at all, but instead try to use webkitgtk. However, if that is not present, or Eclipse is configured not to use it, Eclipse will fall back to using xulrunner. Which can then crash, because Eclipse does not detect that the available xulrunner is incompatible. The Eclipse developers recognize this as a Bad Thing (it is Bug 262929), but it no yet fixed (still in Eclipse 3.7).
Therefore, if webkitgtk is present on your computer, it might be better to tell Eclipse to use it. The Eclipse FAQ says how to do this: set the Java property org.eclipse.swt.browser.UseWebKitGTK to true. You can do so in your eclipse.ini file (as told elsewhere) by adding the line -Dorg.eclipse.swt.browser.UseWebKitGTK=true at the end of the file.

How is the Eclipse JDK setting affecting the system's JDK setting

I was trying to compile a Grails application referencing third party JARs on Mac OSX. Although my system's JRE and JDK is set to Java 1.6 I always got a Compilation error: java.lang.UnsupportedClassVersionError: Bad version number in .class file
when accessing classes in the JAR. Also when testing an existing Grails app the default stats of the app where showing that it's running with Java 1.6. So I really didn't have more ideas than to try to change the Java settings in Eclipse - I thought that's stupid as I'm not using Eclipse for the devlopment of this application - but voila - now the compilation of my app on the command line works just fine!
Can anyone explain me what Eclipse is doing here behind the scenes?
I've had set the JAVA_HOME manually before with no effect.
The JDK (JAVA_HOME) used to launched eclipse is not necessarily the one used to compiled your project.
To see what JRE YOU y can select for your project, check the preferences
General > Java Installed JRE
By default, if you have not added any JRE, the only one declared will be the one used to launched eclipse (which can be defined in your eclipse.ini).
You can add any other JRE you want, including one compatible with your project.
After that, you will need to check in your project properties (or in the general preferences) what JRE is used, with what compliance level: