I have a question....
I have a java file that I compiled and created a jar file with. Now I heard that if you don't have a program defined to open jar files (which winrar is) then it's supposed to open java web start or something and view the .class file within the .jar file. Does anyone know how to do this if .jar files are set to open with winrar?
java question --.jar file [Archive] - ForumsHQ
Re: java question --.jar file [Archive] - ForumsHQ
hrmm... found somethin, i'll try this tonight
save this as a .reg file and run it to import to registry
Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\jarfile]@="Executable Jar File"[HKEY_CLASSES_ROOT\jarfile\shell][HKEY_CLASSES_ROOT\jarfile\shell\open][HKEY_CLASSES_ROOT\jarfile\shell\open\command]@="\"C:\\WINDOWS\\Java\\JRE1.4.2\\bin\\javaw.exe\" -jar \"%1\" %*"
save this as a .reg file and run it to import to registry
Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\jarfile]@="Executable Jar File"[HKEY_CLASSES_ROOT\jarfile\shell][HKEY_CLASSES_ROOT\jarfile\shell\open][HKEY_CLASSES_ROOT\jarfile\shell\open\command]@="\"C:\\WINDOWS\\Java\\JRE1.4.2\\bin\\javaw.exe\" -jar \"%1\" %*"
Re: java question --.jar file [Archive] - ForumsHQ
Now I heard that if you don't have a program defined to open jar files (which winrar is) then it's supposed to open java web start or something and view the .class file within the .jar file.
Not sure what you mean by "view the class file"... class files are compiled code, can't really view their innards (unless you use a java decompiler... altho on an interesting note, there's some AMAZING java decompilers out there which spit out some very readable code)
AFAIK, jar files are just zips, so you can open them with winzip, winrar, etc. The only difference is that they usually always contain some files like the manifest file which helps the JVM figure out whats in the file.
Then there's also war files, that's just a jar (and hence a zip) used for java servlets.
Why all the silly extensions? Who knows, Sun is screwy with specs on stuff like that
Not sure what you mean by "view the class file"... class files are compiled code, can't really view their innards (unless you use a java decompiler... altho on an interesting note, there's some AMAZING java decompilers out there which spit out some very readable code)
AFAIK, jar files are just zips, so you can open them with winzip, winrar, etc. The only difference is that they usually always contain some files like the manifest file which helps the JVM figure out whats in the file.
Then there's also war files, that's just a jar (and hence a zip) used for java servlets.
Why all the silly extensions? Who knows, Sun is screwy with specs on stuff like that
Re: java question --.jar file [Archive] - ForumsHQ
yes, but with most java IDEs you can make a collection of the .class files (and there's an option to include the source as well) and put 'em into a .jar file which is normally executable, and simply locates the main .class file within the .jar file and runs it with java web start i think... i'mma try it right now
Re: java question --.jar file [Archive] - ForumsHQ
check this out... unzip it to a .jar file which is a simple crappy calculator i started for one of my assignments, yet didn't finish. so anyway check it out, it's executable, if you do the .reg file from above.
i tried an applet though, and there was an error, so maybe it only works for applications
i tried an applet though, and there was an error, so maybe it only works for applications
Re: java question --.jar file [Archive] - ForumsHQ
check this out... unzip it to a .jar file which is a simple crappy calculator i started for one of my assignments, yet didn't finish. so anyway check it out, it's executable, if you do the .reg file from above.
i tried an applet though, and there was an error, so maybe it only works for applications
Well, it's executable if you already have java installed... cant really rely on that in general though, if its a program you want to distribute:P
Basically all that reg file change does is associate jar's with "javaw.exe -jar"... thats basically the non-console equivalent of doing "java.exe -jar ..." from the command line.
It won't work with applets since they need appletview to run locally (ie, without a web page). You CAN use jars in a web page though, IIRC you just specificy a jar file instead of a class file in your applet tags (or object/embed tags if you want install-on-demand for the jvm)
i tried an applet though, and there was an error, so maybe it only works for applications
Well, it's executable if you already have java installed... cant really rely on that in general though, if its a program you want to distribute:P
Basically all that reg file change does is associate jar's with "javaw.exe -jar"... thats basically the non-console equivalent of doing "java.exe -jar ..." from the command line.
It won't work with applets since they need appletview to run locally (ie, without a web page). You CAN use jars in a web page though, IIRC you just specificy a jar file instead of a class file in your applet tags (or object/embed tags if you want install-on-demand for the jvm)
-
NIN
Re: java question --.jar file [Archive] - ForumsHQ
nobody wants to see your dumb program :sucks:
Re: java question --.jar file [Archive] - ForumsHQ
nin where teh crap have you been, hit me up on aim you faj