Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Opening JAR as project(Trying to understand how to open a jar as a project in Eclipse.)
Opening JAR as project [message #1854649] Thu, 01 September 2022 05:31 Go to next message
Logan blahtimes2 is currently offline Logan blahtimes2Friend
Messages: 3
Registered: September 2022
Junior Member
Hi! I just want to preface this with the fact I have never properly utilized an IDE, such as Eclipse, before now. Please make things easy for me to understand, where possible.
I am currently trying to open a .jar file as or within a project in Eclipse. So far, this has technically worked, however once I import this all of the files within the jar are not able to be opened for multiple reasons. .class files will not open and say they are missing a source, and .json files will not open as they are cannot open anything that's not from a source (I believe this was the error message, I am writing this from mobile as I'm done trying for today).

For context, I am doing all of this for a personal Minecraft project. I am currently trying to make a small modification to a Minecraft forge .jar mod for my own personal use, and it is exclusively changing sound effects and adding a few more sounds. The file used to call the sound effects is a .class file, and I am completely stumped as to how I can edit this class file and place it back into the jar (I am using WinRAR for this). I haven't found any way to change a .java file back into a .class file, and window's "javac" command isn't working as it is claiming it is missing a source, so I turned to Eclipse to see if I could edit the class within the jar without decompiling it. If there's a better method I'm missing, please inform me!

Thank you in advance!
Re: Opening JAR as project [message #1854655 is a reply to message #1854649] Thu, 01 September 2022 07:49 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 32493
Registered: July 2009
Senior Member
You cannot expect to edit a compiled *.class file. You need the *.java source files. As I understand it, Minecraft is not open source and even the byte code is obfuscated so what you are trying to do is pretty much impossible.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Opening JAR as project [message #1854662 is a reply to message #1854655] Thu, 01 September 2022 15:38 Go to previous messageGo to next message
Logan blahtimes2 is currently offline Logan blahtimes2Friend
Messages: 3
Registered: September 2022
Junior Member
No Message Body
Re: Opening JAR as project [message #1854663 is a reply to message #1854662] Thu, 01 September 2022 15:44 Go to previous messageGo to next message
Logan blahtimes2 is currently offline Logan blahtimes2Friend
Messages: 3
Registered: September 2022
Junior Member
Sorry for the blank reply, thought I'd have to click "post quick reply" for some confirmation box to pop up.

I am aware this may be outside of Eclipse's reach at this point, but I figured I mine as well ask anyway. The mod files I am trying to change are, I believe, open source (if I have the definition right). Everything about the mod can be viewed and changed, but of course changing and redistributing it is frowned upon. The .class files that I am trying to edit can be decompiled into standard .java files using JD-GUIhttp://java-decompiler.github.io/ that I can then edit, my issue is I am unable to then recompile the .java files and turn them into .class files. Is Eclipse able to do this? Recompile .java files into .class files? If so, how?
Re: Opening JAR as project [message #1854664 is a reply to message #1854663] Thu, 01 September 2022 15:55 Go to previous message
Ed Merks is currently online Ed MerksFriend
Messages: 32493
Registered: July 2009
Senior Member
It will probably be good that you read a tutorial:

https://www.vogella.com/tutorials/Eclipse/article.html

Your question is too non-specific to answer.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Cannot Load Classes
Next Topic:Configure Network Proxy Error
Goto Forum:
  


Current Time: Mon Sep 26 13:05:11 GMT 2022

Powered by FUDForum. Page generated in 0.04918 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top