Results 1 to 14 of 14
- 12-24-2011, 03:32 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Need help to compile java files to class
Hello all,
I need some help, i am trying for more then 2 hours to compile my edited .java files to .class files.
But it seems it does not compile it correctly
i made some changes to my current chat applet, edited some mysql and information and now trying to bring it back to class files with this code:
Class-Maker.bat
Oke this works it creates my .class files in all paths.Java Code:Set Path=C:\glassfish3\jdk7\bin javac -g -sourcepath -source -verbose -Xlint:deprecation -Xlint:unchecked chatserver/container/*.java chatserver/gui/*.java chatserver/logging/*.java chatserver/main/*.java chatserver/netio/*.java chatserver/objects/*.java chatserver/roles/*.java chatserver/sql/*.java chatserver/tools/*.java pause
But now i got the issue, i have to put these files back to the "chatserver.jar" and now i use this command:
Jar-Maker.bat
Manifest.txtJava Code:Set Path=C:\glassfish3\jdk7\bin jar -cf chatclient/chatclient.jar META-INF/Manifest.txt chatclient/applets/*.class chatclient/applets/canvas/*.class chatclient/applets/challengees/*.class chatclient/applets/components/*.class chatclient/applets/note/*.class chatclient/netio/*.class chatclient/tools/*.class pause
Now it makes a jar file, but the original size of my chat applet jar file is 325KB but it recompiles it only for 50% i have 185KB what am i doing wrong :(?Java Code:Class-Path: chatserver.jar
can somebody please help me?
It makes new
- 12-24-2011, 03:56 PM #2
Re: Need help to compile java files to class
Have you looked into the jar file to see if its contents are all there? Use a zip utility.
I think you need to use the -m option with the jar command to properly install the manifest file into the jar.
- 12-24-2011, 03:59 PM #3
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Need help to compile java files to class
I did that but its not working, i get output file -m
- 12-24-2011, 04:02 PM #4
Re: Need help to compile java files to class
Can you show the command that you used?I did that but its not working,
Here is a command line I use:
jar -cmf BuildDoit.mnf %DEV_HOME%\JavaDevelopment\BuildDoIt.jar BuildDoIt*.class
- 12-24-2011, 04:08 PM #5
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Need help to compile java files to class
Set Path=C:\glassfish3\jdk7\bin
jar -cf -m chatserver.jar chatserver/META-INF/Manifest.txt chatserver/gui/*.class chatserver/logging/*.class chatserver/main/*.class chatserver/netio/*.class chatserver/objects/*.class chatserver/roles/*.class chatserver/sql/*.class chatserver/tools/*.class
pause
- 12-24-2011, 04:11 PM #6
Re: Need help to compile java files to class
Did you look at my sample jar.exe commandline?
- 12-24-2011, 04:23 PM #7
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Need help to compile java files to class
yes i used youre code now:
Set Path=C:\glassfish3\jdk7\bin
jar -cmf BuildDoit.mnf %DEV_HOME%\chatserver.jar chatserver/META-INF/Manifest.txt chatserver/gui/*.class chatserver/logging/*.class chatserver/main/*.class chatserver/netio/*.class chatserver/objects/*.class chatserver/roles/*.class chatserver/sql/*.class chatserver/tools/*.class
pause
it works, but i dont creates jar file?
- 12-24-2011, 04:25 PM #8
Re: Need help to compile java files to class
Were there any errors? Where did you look for the .jar file?
Copy the contents of the command prompt window for when you execute the jar command.
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.
- 12-24-2011, 04:27 PM #9
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Need help to compile java files to class
C:\Users\Atomski-Mrav\Desktop\Output\chatserver.jar\chatserver\src> Set Path=C:\g
lassfish3\jdk7\bin
C:\Users\Atomski-Mrav\Desktop\Output\chatserver.jar\chatserver\src> jar -cmf Buil
dDoit.mnf \chatserver.jar chatserver/META-INF/Manifest.txt chatserver/gui/*.clas
s chatserver/logging/*.class chatserver/main/*.class chatserver/netio/*.class ch
atserver/objects/*.class chatserver/roles/*.class chatserver/sql/*.class chatser
ver/tools/*.class
C:\Users\Atomski-Mrav\Desktop\Output\chatserver.jar\chatserver\src> pause
Druk op een toets om door te gaan. . .
- 12-24-2011, 04:30 PM #10
Re: Need help to compile java files to class
Did you create a manifest file called: BuildDoit.mnf?
Did you look for a chatserver.jar file?
- 12-24-2011, 04:31 PM #11
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Need help to compile java files to class
Yes i have created empty file BuildDoit.mnf nothing changes to that file still at 0KB, and the chatserver.jar does not appear at all
- 12-24-2011, 04:32 PM #12
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Need help to compile java files to class
Set Path=C:\glassfish3\jdk7\bin
jar -cmf BuildDoit.mnf chatserver.jar chatserver/META-INF/Manifest.txt chatserver/gui/*.class chatserver/logging/*.class chatserver/main/*.class chatserver/netio/*.class chatserver/objects/*.class chatserver/roles/*.class chatserver/sql/*.class chatserver/tools/*.class
pause
if i do this it works, but like said it only creates 50% of the jar file dont get it.
- 12-24-2011, 04:40 PM #13
Re: Need help to compile java files to class
If there were no error messages, then there should have been a jar file created. Did you look at the root of the drive?
Why are you using an empty manifest file: BuildDoit.mnf? What is in the file: Manifest.txt ?
- 12-24-2011, 07:24 PM #14
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Need help to compile java files to class
I have fixed it:
Now the only problem i have is my passwords are not being stored into the database correctly:
for example:
If a user is logged in to the chat and uses the command:
/register nickname password e-mail
It register his nickname, with the password, and email without problems
but once i reconnnect it ask me to input password, i do this and it says its wrong?
here is my table:
what am i doing wrong?Java Code:CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` text NOT NULL, `password` text NOT NULL, `roleid` int(11) NOT NULL, `roleby` text NOT NULL, `age` text NOT NULL, `gender` text NOT NULL, `city` text NOT NULL, `homepage` text NOT NULL, `extra` text NOT NULL, `email` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=Xeround DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `name`, `password`, `roleid`, `roleby`, `age`, `gender`, `city`, `homepage`, `extra`, `email`) VALUES (1, 'admin', 'password', 2, 'Admin', '23', 'Man', 'Rotterdam', 'http://www.myble.nl', ':)', 'n.merciano@gmail.com'), (2, 'dimos', 'pass', 2, 'dimos', '', '', '', '', '', 'email'), (3, 'lukas', 'test', 2, 'Lukas', '', '', '', '', '', 'test@test.nl');
Similar Threads
-
Compile a set of java files for a sudoku program
By kanishk.dudeja in forum New To JavaReplies: 3Last Post: 06-16-2011, 04:52 PM -
[Compiling] How to compile .java files with .jar and put in another folder
By szmitek in forum New To JavaReplies: 0Last Post: 11-26-2010, 09:34 PM -
How to Compile JavaScript source into Java class files
By tosreejith in forum New To JavaReplies: 0Last Post: 04-06-2009, 03:12 PM -
Running .java-files won't work/compile does!(Code inside)
By wyldstyle in forum New To JavaReplies: 6Last Post: 02-06-2009, 08:05 PM -
[SOLVED] Java Class won't compile
By kaizen in forum Java AppletsReplies: 9Last Post: 10-18-2008, 06:55 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks