Jump to content

Running Java Apps with Java 7 and Java 8


loblo

Recommended Posts

Ok, I meant to post this a year ago but late than never, isnt'it?

Java 7 and 8 mostly don't work because of missing functions in psapi.dll that KernelEx doesn't provide and KexStub is useless for them too so I made a dummy psapi.dll that works and which you can find attached to this post.

As to not interfere with KernelEx's own psapi handling this dll is renamed psapx.dll and the file that requires it (jvm.dll in the bin/client folder) needs to be edited with an hex editor: PSAPI.DLL -> PSAPX.DLL.

I don't recommend trying to do a standard install of Java 7 or 8 and actually I am not even sure the latest version install properly but to install them as portable JREs so they won't mess up with working Java 6 installs in the registry.

Installing portable Java is easy. Use 7-Zip to extract the contents of core.zip that's inside the installer to a folder of your choice such as C:\Program Files\Java\jre7 or C:\Program Files\Java\jre8. Then use the unpack200.exe found in the bin directory to unpack all .pack files found in the lib directory and subdirectories. I do copy unpack.exe to the lib directory and use this batch file (with 4Dos) to do the job:

unpack200 charsets.pack charsets.jarunpack200 deploy.pack deploy.jarunpack200 javaws.pack javaws.jarunpack200 jsse.pack jsse.jarunpack200 plugin.pack plugin.jarunpack200 rt.pack rt.jarunpack200 ext\jfxrt.pack ext\jfxrt.jarunpack200 ext\localedata.pack ext\localedata.jardel charsets.packdel deploy.packdel javaws.packdel jsse.packdel plugin.packdel rt.packdel ext\jfxrt.packdel ext\localedata.packcls

And then, once you've hexed jvm.dll as per instructions above and the attached psapx.dll is somewhere in the path, your JRE 7 or 8 is ready to use.

Most convenient way to use it is to add entries in the context menu for jar files such as:

REGEDIT4[HKEY_CLASSES_ROOT\jarfile\shell\Run with Java 7\command]@ = "\"C:\\Program Files\\Java\\jre7\\bin\\javaw.exe\" -jar \"%1\" %*"[HKEY_CLASSES_ROOT\jarfile\shell\Run with Java 8][HKEY_CLASSES_ROOT\jarfile\shell\Run with Java 8\command]@ = "\"C:\\Program Files\\Java\\jre8\\bin\\javaw.exe\" -jar \"%1\" %*"

That's it.

It works with most but not all java apps as I have found out a very few wouldn't run because they rely on awt.dll which has missing defs KernelEx doesn't provide and I was unable to figure out working ones in KexStub.

psapx.7z

Edited by loblo
Link to comment
Share on other sites


My first focus was on the browser plugin. Java 7 (classic) works on one machine and only partly on others in Opera 10.1 here. The plugin completely fails in Firefox 3.5.19. The Java 7 control panel doesn't open: Java virtual machine launcher > A Java exception has occured. I currently have little time for long series of tests. Maybe next week I will investigate the (my) problem in more detail. :)

Link to comment
Share on other sites

Sounds good schwups, my focus wasn't browser plugin at all as I don't really care but running standalone java programs so it's cool you're looking into that.

I can run control panels of my portable JRE7 and portable JRE8 (both latest versions, u51 and b132 respectively) without problems by double-clicking on the respective javacpl.exe programs btw.

Edited by loblo
Link to comment
Share on other sites

Probably Firefox 3.5.19 isn't compatible with version 7 anymore!

System requirements of java 7:

Windows
Windows 8 (Desktop)
Windows 7
Windows Vista SP2
Windows XP SP3 (32-bit); Windows XP SP2 (64-bit)
Windows Server 2008
Windows Server 2012 (64-bit)
RAM: 128 MB; 64 MB for Windows XP (32-bit)
Disk space: 124 MB
Browsers: Internet Explorer 7.0 and above, Firefox 3.6 and above, Chrome

Kext with the definition "[Advapi32.dll] AddAccessDeniedAceEx=z5e" http://www.msfn.org/board/topic/157173-kext-diy-kernelex-extensions/?p=1036745 you found last year is needed to run the plugin in Opera 10.1 or 10.01.
Kstub822 also supports the required def. "[Kernel32.dll] InterLockedPopEntrySList".

Java 7 control panel:
I guess my systems need one more definition, a better or more to open it. What definitions you added to your Kstub822?

Edited by schwups
Link to comment
Share on other sites

Java 7 control panel:

I guess my systems need one more definition, a better or more to open it. What definitions you added to your Kstub822?

Try those below, actual defs may not be needed and, if not, those are very probably suboptimal so if you've got any of those functions already covered they should be OK as you have them.

[Advapi32.dll]

AddAccessAllowedAceEx=z5e

[shell32.dll]

SHGetKnownFolderPath=f4

[user32.dll]

RealGetWindowClassW=f3

How did you get the plugin running in Opera 10, did you do a proper install of Java 7 or did you do it manually?

Link to comment
Share on other sites

[Advapi32.dll]
AddAccessAllowedAceEx=z5e

already exists in the original ini file and the two others have no effect to open the J7 panel.

K452stub.log:

= Kernel32.dll:HeapSetInformation=z4 ;? =
= Kernel32.dll:HeapSetInformation=z4 ;? =
= Advapi32.dll:OpenSCManagerA=r0xCAFEs3 =

Kstub822.log:

= Kernel32.dll:InitializeSListHead=f1 =
= Kernel32.dll:InitializeSListHead=f1 =

How did you get the plugin running in Opera 10, did you do a proper install of Java 7 or did you do it manually?

I removed older versions and installed version 7. I used the ImportPatcher instead of an hex editor to edit the Java HotSpot Client VM (virtual machine) jvm.dll. I believe there is no need to uninstall older versions. The java 7 plugin works in Opera 10 with Java 6 and 7 installed. I was able to install it, but wasn't able to run applets without your psapx.dll.

Link to comment
Share on other sites

schwups, the two function logged by your kstub452 aren't handled by KexStub here and I have InitializeSListHead=f1 so none of those should be a problem.

As I can't figure out something else I am attaching to this post my kstub822.ini for you to try but be aware that it's most probably not really up to date in terms of latest/best definitions for some functions.

kstub822.7z

Edited by loblo
Link to comment
Share on other sites

  • 7 years later...

So, as you had done in your first post, I have extracted the core.zip and unpacked all the .pack files, and while this install works on my main pc, Windows 10, it fails under Win98 with "Error: Loading: msvcr100.dll" as well as "Error: Loading: jvm.dll" I tried to install MSVC++ 10 however it requires windows installer 3 which requires windows NT. so I ask you; how did you get java 7 working under windows 98?

Link to comment
Share on other sites

On 7/23/2021 at 6:28 AM, MilesPrower2048 said:

So, as you had done in your first post, I have extracted the core.zip and unpacked all the .pack files, and while this install works on my main pc, Windows 10, it fails under Win98 with "Error: Loading: msvcr100.dll" as well as "Error: Loading: jvm.dll" I tried to install MSVC++ 10 however it requires windows installer 3 which requires windows NT. so I ask you; how did you get java 7 working under windows 98?

There is no need to hex-edit the dll file anymore. You can simply substitute psapi.dll in the KernelEx folder with the updated one:

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...