0

So, I'm actually coding primarily in python, but I need to do one thing in java, and having no java experience, I'm really not understanding how this works.

My program creates java files, then compiles them with command prompt, and puts them into the minecraft.jar, but I don't really understand what I need to write in command prompt to set the classpath to the minecraft.jar. Especially because I need this to work on everyone's computer, and I won't know where my program (and thus the java files) are.

Could anyone give me a hand with this?

Edit: Okay, so I tried doing this:

javac -classpath %appdata%\.minecraft\bin\minecraft.jar BLOCK1.java 

And it gives me this error:

LLBLOCK1.java:3: error: cannot find symbol
public class LLBLOCK1 extends Block
                              ^
  symbol: class Block
LLBLOCK1.java:5: error: cannot find symbol
    private World worldObj;
            ^
  symbol:   class World
  location: class LLBLOCK1
LLBLOCK1.java:12: error: cannot find symbol
        public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
                                      ^
  symbol:   class World
  location: class LLBLOCK1
LLBLOCK1.java:12: error: cannot find symbol
        public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
                                                                        ^
  symbol:   class EntityPlayer
  location: class LLBLOCK1
LLBLOCK1.java:9: error: cannot find symbol
        super(i, j, Material.wood);
                    ^
  symbol:   variable Material
  location: class LLBLOCK1
LLBLOCK1.java:14: error: package Block does not exist
world.setBlockWithNotify(i + 0, j + 0, k + 0, Block.stone.blockID);
                                                   ^
6 errors

Am I writing the classpath wrong?

MrLore
  • 3,759
  • 2
  • 28
  • 36
Lemony Lime
  • 1,113
  • 3
  • 11
  • 12

2 Answers2

0

If you are compiling the jar, you can type in the location of the output for the jar:

-jar cvfm c:/users/matt/documents/Minecraft.jar manifest.txt *.class

I believe this would work if you were to create your own jar. This would be easier then directly editing the Minecraft jar.

Matt
  • 95
  • 6
0

the minecraft.jar is almost always located in

C:\Users\User_Name\AppData\Roaming\.minecraft\minecraft.jar

In batch language you can use:

%appdata%/.minecraft/minecraft.jar

However you may want to also back it up first, copy and rename the minecraft.jar so if anything goes horibly wrong you can always restore it easier.

D3_JMultiply
  • 1,022
  • 2
  • 12
  • 22
  • I think I may be writing the classpath wrong. I put the error message in my first post. – Lemony Lime Dec 09 '11 at 21:55
  • yes, well it may help if you put 4 spaces or 1 tab before each line of the error, show it shows as a code, and is easier to read. – D3_JMultiply Dec 10 '11 at 15:11
  • Also, all your errors are coming from the minecraft files themselves, what is LLBLOCK1? People can't help debug errors if you don't supply code. The errors seem to have no relation to compiling a jar file, the errors relate a lot more to as if you were making a mod – D3_JMultiply Dec 10 '11 at 15:21