I am working on a program that essentially generates another java program. The program generates some folders, a java class, and then a Batch file to compile the newly generated program.
Here is the layout of how stuff is generated
Root folder (PluginGenerator in my case)
PluginGenerator (Program which creates the new program)
Bukkit.jar (Compiled with new classes)
Compiler.bat (gets created when new program is generated)
data.txt (not used)
New project/program folder (HelloPlugin in my case)
data folder
plugin.yml (to be compressed into jar)
com
package
generated class file (HelloPlugin in my case)
output folder (.jar file needs to be created here)
So once the Hello class has been generated a batch file geets made in the root folder. The batch file needs to compile HelloPlugin.java into a class file and put the package (com.pack) into a jar along with plugin.yml.
The location of the rootfolder cotaining everything is found in my java program and is used to write the correct directories in the batch file.
I know i can compile files with the built in JavaCompile, but I want to do it this way for fun.
Everything works except the batch file. The class gets compiled but the jar it creates only contains the META-INF folder with the manifest, but not the plugin.yml or package containing the class.
I don't have mauch experienve with batch or compiling with CommandPrompt so i'm not sure why it isn't working.
Here is the Batch file that gets generated
@echo off
javac -cp C:/Users/Aiden/Desktop/PluginGenerator/Bukkit.jar C:/Users/Aiden/Desktop/PluginGenerator/HelloPlugin/data/com/pack/HelloPlugin.java
jar cf C:/Users/Aiden/Desktop/PluginGenerator/HelloPlugin/output/HelloPlugin.jar C:/Users/Aiden/Desktop/PluginGenerator/HelloPlugin/data/plugin.yml C:/Users/Aiden/Desktop/PluginGenerator/HelloPlugin/data/com
pause
EDIT I think it I may have packed the whole of my C drive into the jar. Although that would take a long to to compress into the jar, so thats not exactly want has happened.
Anyway he is a picture of what the jar contains.