obfuscator icon indicating copy to clipboard operation
obfuscator copied to clipboard

java/lang/Object is missing in the classPath.

Open itsvic-dev opened this issue 4 years ago • 8 comments

ERROR: java/lang/Object is missing in the classPath.

Expected Behaviour

The JAR gets obfuscated, and the output gets written into the output JAR.

Actual Behaviour

The output JAR is empty, with the following obfuscator log:

Loading classpath...
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/charsets.jar (0%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/ext/cldrdata.jar (6%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/ext/dnsns.jar (13%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/ext/jaccess.jar (20%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/ext/localedata.jar (26%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/ext/nashorn.jar (33%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunec.jar (40%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunjce_provider.jar (46%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunpkcs11.jar (53%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/ext/zipfs.jar (60%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/jce.jar (66%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/jsse.jar (73%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/management-agent.jar (80%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/resources.jar (86%)
Loading /usr/lib/jvm/java-8-openjdk/jre/lib/rt.jar (93%)
Reading input...
Building Hierarchy...
Finishing...
>>> Processing completed. If you found a bug / if the output is invalid please open an issue at https://github.com/superblaubeere27/obfuscator/issues
ERROR: java/lang/Object is missing in the classPath.
me.superblaubeere27.jobf.utils.MissingClassException: java/lang/Object is missing in the classPath.
	at me.superblaubeere27.jobf.JObfImpl.buildHierarchy(JObfImpl.java:103)
	at me.superblaubeere27.jobf.processors.name.NameObfuscation.transformPost(NameObfuscation.java:62)
	at me.superblaubeere27.jobf.JObfImpl.processJar(JObfImpl.java:314)
	at me.superblaubeere27.jobf.JObf.main(JObf.java:231)

How to reproduce the behaviour

Use the following config under Arch Linux with OpenJDK 8.

{
	"libraries": [
		"/usr/lib/jvm/java-8-openjdk/jre/lib/charsets.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/ext/cldrdata.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/ext/dnsns.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/ext/jaccess.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/ext/localedata.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/ext/nashorn.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunec.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunjce_provider.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunpkcs11.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/ext/zipfs.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/jce.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/jsse.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/management-agent.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/resources.jar",
		"/usr/lib/jvm/java-8-openjdk/jre/lib/rt.jar"
	],
	"Crasher": {
		"Enabled": true,
		"Invalid Signatures": true,
		"Empty annotation spam": true
	},
	"InvokeDynamic": {
		"Enabled": true
	},
	"Optimizer": {
		"Enabled": true,
		"Replace String.equals()": true,
		"Replace String.equalsIgnoreCase()": true,
		"Optimize static string calls": true
	},
	"LineNumberRemover": {
		"Enabled": true,
		"Rename local variables": true,
		"Remove Line Numbers": true,
		"Remove Debug Names": true,
		"Add Local Variables": true,
		"New SourceFile Name": ""
	},
	"StringEncryption": {
		"Enabled": true,
		"HideStrings": true,
		"AES": true
	},
	"NumberObfuscation": {
		"Enabled": true,
		"Extract to Array": true,
		"Obfuscate Zero": true,
		"Shift": false,
		"And": false,
		"Multiple Instructions": true
	},
	"ShuffleMembers": {
		"Enabled": true
	},
	"InnerClassRemover": {
		"Enabled": true,
		"Remap": true,
		"Remove Metadata": true
	},
	"NameObfuscation": {
		"Enabled": true
	},
	"FlowObfuscator": {
		"Enabled": true,
		"Mangle Comparisons": true,
		"Replace GOTO": true,
		"Replace If": true,
		"Bad POP": true,
		"Bad Concat": true,
		"Mangle Switches": false,
		"Mangle Return": false,
		"Mangle Local Variables": false
	},
	"HideMembers": {
		"Enabled": true
	},
	"Packager": {
		"Enabled": true,
		"Use MainClass from the JAR manifest": true,
		"Main class": "Main"
	}
}

itsvic-dev avatar May 24 '20 14:05 itsvic-dev

Happens to me and cant fix it

MineGame159 avatar Jun 09 '20 18:06 MineGame159

Can you confirm /usr/lib/jvm/java-8-openjdk/jre/lib/rt.jar contains java/lang/Object.class ?

x4e avatar Sep 02 '20 01:09 x4e

@cookiedragon234 It does. image

itsvic-dev avatar Sep 05 '20 18:09 itsvic-dev

Same happens to me on Windows but only while using CLI, not with GUI for some reason

HeyaGlitz avatar Nov 04 '20 10:11 HeyaGlitz

Happens to me on linux, I cant get name obfuscation to work. It is really annoying becuase gui doesn't work.

czho avatar Jan 26 '21 01:01 czho

Once you're with the NameObsfucation enabled, that error occurs.

eikefab avatar Jan 31 '21 17:01 eikefab

This error also happens to me when using the GUI on Windows: image Can't we just parse the standard library classes from the Java installation which runs the GUI for instance? It seems like this could be fixed automatically pretty easily.

BullyWiiPlaza avatar Aug 14 '21 16:08 BullyWiiPlaza