Class « jar « Java I/O Q&A





1. How to use classes from .jar files?    stackoverflow.com

I read the Java tutorials on Sun for JAR files, but I still can't find a solution for my problem. I need to use a class from a jar file called ...

2. JarScan, scan all JAR files in all subfolders for specific class    stackoverflow.com

We are seeing an older version of a class being used, although we had the latest one deploy. To scan all JAR files in all subfolders of an application server, how ...

3. How to know which classes inside a .jar file are referenced?    stackoverflow.com

I need to deploy only the referenced classes in a very limited environment as A data carousel for Interactive TV. Bandwidth is expensive and .jar files are not supported. ...

4. JavaBeans Classes in Separate JAR Files    stackoverflow.com

Is it possible to build classes for a JavaBean in separate JAR files? Specifically- a JavaBean has the Bean and BeanInfo classes in one JAR file and the Custom Property ...

5. Can pack200 be used to compress class files to run on jdk 1.4?    stackoverflow.com

I would like to compress a jar file as much as possible for distribution (for downloading over dial-up modem). Can pack200, which was included in jdk5, be used on pre-jdk5 ...

6. What are my free and/or open source options for decompiling class files and JARs?    stackoverflow.com

I'm familiar with JAD, and haven't found anything newer or better, but I really didn't look that hard because I had previous experience with the JAD tool. However, I ...

7. How do I print the class structures in a jar file using the javap tool?    stackoverflow.com

I want to list the methods of the class files in the jar using the javap tool. How do I do it so that it lists the methods and members of ...

8. How should i use a jar file?    stackoverflow.com

I have a jar file which contains some classes those which i want to use in my project. I am working in command line and not in eclipse. Please tell me ...

9. Safe class imports from JAR Files    stackoverflow.com

Consider a scenario that a java program imports the classes from jar files. If the same class resides in two or more jar files there could be a problem.

    ...





10. Iterate over classes in jar file    stackoverflow.com

Anyone knows a 2-3 line solution for iterating over classes in some Jar file ? ( I have an instance of java.net.URL in my hand ) Thanks

11. Making ANTLR generated class files into one jar file    stackoverflow.com

With ANTLR, I get some java class files after compilation. And I need to make all the class files into one jar file. I make manifest.mf file that has one line "Main-class: ...

12. The same class file in multiple .jar files. How bad is this?    stackoverflow.com

I have a library that writes data in either a text or binary format. It has the following three components:

  1. common data structures
  2. text writer (depends on 1)
  3. binary writer (depends on 1)
The ...

13. Scan class or jar file in Java    stackoverflow.com

I need to scan class or jar file that implements or extend a specific class.
It's the same mechanism that Eclipse use to scan the plugin presence. There is a way to do ...

14. How to generate JavaDoc documentation for classes in a .jar file that I don't have the source code for?    stackoverflow.com

I want to generate the API for all the classes that are there in my Java 1.6 application. It should look like regular Java 1.5 API documentation.

15. java class not found despite providing a jar file    stackoverflow.com

I'm puzzled by the process of running java programs, maybe you can help. I have several .java files in ~/working_dir/org/project/ that have main functions, and I want to package them in a ...

16. How to view the method members of a class within a jar file thru the command line    stackoverflow.com

I am trying to look at the method members of a class within a jar file. Currently to list all the classes within a jar file, one can call this command: jar ...





17. In memory jar / class file execution    stackoverflow.com

I have a jar file (say app.jar) in a certain location available as a file/stream from an http server. The problem is that app.jar is itself a frequently updated jar ...

18. Listing classes in a jar file    stackoverflow.com

How can I dynamically load a jar file and list classes which is in it?

19. When will the "jar" command refuse to add a class to a .jar file?    stackoverflow.com

I have 204 total classes (most of the classes are inner classes). For months, I have been building fine with SCons (SCons just calls the jar command). For some reason, it ...

20. How do I make a java.io.File into a java.lang.Class to run it?    stackoverflow.com

I have a program that lets a user select any .class or .jar file and run it. The problem is that, to run it, I need to use something other than ...

21. Open and edit file in .jar with Java?    stackoverflow.com

How would you go about opening an .xml file that is within a .jar and edit it? I know that you can do...

InputStream myStream = this.getClass().getResourceAsStream("xmlData.xml");
But how would you open the xmlData.xml, ...

22. Java program using a class from a JAR file    stackoverflow.com

I'll try to phrase this as best I can. I have a program which has an API-like functionality - it uses reflection to dynamically call methods from within a class. In ...

23. creating jar files for non .class files    stackoverflow.com

i'm trying to create a jar file for non .class files. I am following the same process just like for creating a jar file for .class files but using . like jar ...

24. Hiding classes in a jar file    stackoverflow.com

is it really impossible to hide some classes in a jar file? I wanted not to allow direct instantiation of the classes to keep it more flexible. Only the factory (or a ...

25. Java Class PPM, PPMImage not found, where to get JAR Files    stackoverflow.com

I need help and wanted to ask if somebody knows where to get the JAR Files for my system library (eclipse helios), cause I need to use those classes PPM and ...

26. java class file to jar app    stackoverflow.com

i want to know how to make a jar app which will run on java mobile platform using class file of java. i know basics of java like inheritance,interface,string.....I tried this thing ...

27. Performance hit using JAR files    stackoverflow.com

Do you take a performance hit when packaging you classes into Jar files rather than just running the unpackaged classes? Say for example you have a large application, if many files ...

28. converting class file to jar file using c++    stackoverflow.com

Is it possible to convert .class file to .jar file using c++ code? (i.e can we write a code in c++ that when executed converts given .class file to .jar file) If ...

29. Location of currently running class or JAR file    stackoverflow.com

I have a Lotus Notes database which is performing some interaction with a remote web service. I've written a custom Java class to perform the interaction. The class methods can ...

30. Run class in Jar file    stackoverflow.com

if you have a jar file called myJar.jar in /myfolder and you want to use myClass from it, how do you go about doing it from the command line? i thought it ...

31. Each class has two classfiles in jar file    stackoverflow.com

I have a jar file which has two class files per java file. Java:

Foo.java
Bar.java
Classfile:
Foo.class
Foo.class
Bar.class
Bar.class
I have verified that there is only one java files per class. The java files do not any contain ...

32. supplying javadoc in "class only" jar file    stackoverflow.com

I am distributing jar file for client as an API jar. I DON'T want them to see my source code (and say 'your code sucks'), but I want them to be ...

33. Importing Java classes into Jython using .class files instead of jars    stackoverflow.com

I've been searching for a while and cannot seem to find an answer to this problem. Is it possible to import a user-defined .class file into Jython directly without it being ...

34. Issue while importing class file from a JAR    bytes.com

Hi.. I have import statement in a JSP...and importing a class file located in a JAR....but when I run that JSP it show error Package does not exist..... I have put ...

35. embedding a jar file into a class??    coderanch.com

So i was being nosy today and cracked open the jar file for the java blue prints catalolg installer (bpcatalog-1.0.1_01-installer.jar). I see a meta-inf directory and a manifest file inside that. I also see a bpcatalog.class file at the root of the jar. Standard stuff right? Except for fact that the class file is a bit plump, 3.73 MB to exact. ...

36. problem using getSize on classes in jar file    coderanch.com

My Java experience is rather limited (socket applets) so I have been tinkering with other topics to broaden my experience. I have written a small utility using reflection to examine class files and now I am trying to include the ability to look at classes inside a jar file. Using the following code I can find the classes in a jar ...

37. Invoke a Class from a Particular JAR file    coderanch.com

I have a Class with under a package com.pkg.test which I have a Packaged as JAR file say JAR1 ----------------------JAR1------------------------------------- package com.pkg.test; public class ClassA { public static int T = 1000; private String id = null; public ClassA(){ this.id = "In Jar 1"; } public void printID(){ System.out.println(this.id); } } -------------------------------------------------------------------- I have another JAR file with the same class ...

38. how to search a class in list of jar files    coderanch.com

Hi All, I am using Windows XP. I have some 100's of jars and I want to find in which jar file a particular class exists. The search option in Windows XP (except Windows 2000) doesn't help. I tried the sourceforge.net jarbrowser tool but it's search functionality is not working. Can anybody please suggest a nice tool or approach ... Thanks ...

39. Calling class file inside a jar    coderanch.com

40. Adding a class to a .jar file    coderanch.com

I have a desktop app and I want to load class files from my server and load them into the app. I can dynamically load the class, but I'm having class path issues when I compress the app into a .jar. I tried starting the app like this: java -cp /dir_where_downloaded_classes_are -jar /the_app.jar but it's not working. Is it possible to ...

41. same class in two jar files    coderanch.com

I seem to recall having this problem as the cause for an "unexplainable bug" a couple of years back. Different version of class a was included in two different jar-files, and I kept getting the same old bug even though I knew I had included the new version. The explanation was that the order in which the jar-files was included in ...

42. Detect presence of class file in JAR...    coderanch.com

I'm working on a simple plug-in system for a Java program. I can't seem to find a way to determine if a JAR file contains a class that implements a particular interface. I need to be able to do discover this programmatically. If the JAR file does contain an implementation of the interface, I need to be able to obtain the ...

43. How to enumerate jar files and the classes in them?    coderanch.com

How do I write a java program that will enumerate all the jar files that are loaded and then enumerate all the classes in those jar files? How do I dynamically add a jar file to my class path and load a class from it? SQuirreL does this when you specify jdbc drivers. Thanks, Siegfried

44. Is class file in a Jar affect ?    coderanch.com

Hai, I am working in a customized framework in my company.Source files for the Infrasturcture classes is not available NOW. Earlier it was available.That is in the earlier version of XXXX.jar contains both .java and .class files.Newer version of XXXX.jar contains only .class files.I am using RAD environment. I attached the source via old version of XXXX.jar by using "attach source" ...

45. how to specify a class file in jar    coderanch.com

46. classes in jar files    coderanch.com

Can you replace one of the class files in a jar file? I have a jar file which contains hundreds of class files. I want to add a tiny little thing to one of those classes and see it in action when I run the jar. So I want to overwrite the existing class version in the jar file. Can this ...

47. running from .jar file has missing classes    coderanch.com

I am creating my first .jar file and having bad luck. I can execute my application normally, and it runs. When I jar it it cannot find my Oracle JDBC driver. To me, it seems if the Oracle .jar (classes12.jar) was not in the classpath I wouldn't be able to execute by just saying "java TextAreaAudit". It connects to the database ...

48. cant add class file to jar    coderanch.com

Confession from an experienced Java developer: If I encounter the need to add any kind of file (*.class included) to a ZIP, I mean, a JAR file, I use a ZIP utility like WinZip (which is not the only ZIP util). I hope I don't become ostracized from the Java community for confessing. Reality Check: Obviously I develop in a Win32 ...

49. Running alternate class in jar file    coderanch.com

50. Why Class.forName does not work when calling from jar file    coderanch.com

It works to find classes inside a jar file, if the class file truly is available. All I can tell you is to check carefully and make sure the jar file is really available at runtime. The CLASSPATH environment variable will be ignored when running a program from Eclipse, as I hope you're already aware.

51. not able identify class files in one of the jars.    coderanch.com

Hi Guys, i am facing below error while running one of my application in windows. MessageXmlBuilder.java:12: cannot access com.bch.blah.blah.message.batch.MessageBatchConstants bad class file: F:\jars\message_batch.jar(com/bch/blah/blah/message/batch/MessageBatchConstants.class) class file has wrong version 50.0, should be 49.0 Please remove or make sure it appears in the correct subdirectory of the classpath. import com.bch.blah.blah.message.batch.MessageBatchConstants; ^ and i am facing below error while running in Ubuntu MessageXmlBuilder.java:335: error: ...

52. Looking for someone to help me change a .class file in a .jar file    coderanch.com

Hi, I'm looking for someone to help me with a enhancements to a program I'm using. It's opensource and the enhancements is public available but I'm not a programmer yet, I just don't know any thing about Eclipse although I tried. There are "simple" instructions in the manual but I'm not finding it simple. Can anyone please help me. I think ...

54. Adding .class file in a jar file    coderanch.com

55. Using a class from a Jar File    coderanch.com

I was working through the excercises in this website's cattle drive section but then I got to one where it said I have to dowload a jar file and use a class in there. So I found out how to extract files from a jar file using the -xf command, but I feel like I am missing something. Am I supposed ...

56. modifying a class file inside jar    go4expert.com

58. Java class uses another class in a Jar file (How do I make Java see it)?    forums.oracle.com

I am trying to figure out how do I make Javac see the thinlet.class in the thinlet.jar. I have developed an XUL xml interface and a java program that calls the interface shown below: //package thinlet.demo; import thinlet.*; public class UI extends Thinlet { public UI () throws Exception {add(parse("UI.xml"));} public static void main(String[] args) throws Exception { new FrameLauncher("UI", new ...

59. class files in jar    forums.oracle.com

60. how to add only the class files into jar file    forums.oracle.com

61. Writing a class to provide Self ID capability in a JAR file.    forums.oracle.com

Hello, I need to write a class which reads and prints out the contents of the manifest file of the JAR file of which it is a part. I've got the code for reading the manifest file, which I've included below. My question is this: how can I get this class to find out the name of the JAR file it's ...

62. class file works, jar does not...    forums.oracle.com

Hey - I have been working on an application in XP which contains several class files. The project is now finished and has been running perfectly from within my jde, so I decided to create a jar and test it out. I executed the jar, and several of my menu items do nothing. So I executed it through cmd prompt and ...

63. adding a class a *.jar file    forums.oracle.com

64. Convert from .class file to .jar file    forums.oracle.com

65. Using classes in jar file    forums.oracle.com

I have added a jar file to my eclipse project, and inside the jar file are the classes I want to access, but when I try to import them into my classes, the import wont find them. How can I use an import statement on them? e.g. import ocss.nmea.api.NMEAReader; the import cannot be found, but ocss is inside a jar file ...

67. Conversion of jar file to class file    forums.oracle.com

Careful... As a general rule of thumb decompiling other peoples classes is a tad naughty... and in some cases is actually against the law... and in some cases it's actively enforced... if it was open source it would come with source code. Having said that... Yeah, DJ can be a life saver. Cheers. Keith.

68. call executible JAR file inside a Java Class    forums.oracle.com

What java -jar file.jar does is run the main-method in the Main-Class defined in the jar file's manifest. If you have the jar file on the classpath, your other java program should be able to see that Main-Class, and just call its main method directly. Edited by: ezo on Aug 20, 2010 3:43 PM

69. Determining jar file associated with a class's method    forums.oracle.com

Hi, I'm looking for the best way to determine the one or more jar files associated with a class's method in my project. org.w3c.dom.Node.getTextContent() is a method that is being found in one of my projects but not in the other. I'm presuming that this is being caused by the fact that one jar contains the Java 5 version of this ...

70. Adding a file to a jar with jarOutputStream class methods    forums.oracle.com

I'm using jarOutputStream.putNextEntry() method in a program to add a DOM created XML file to an existing JAR. The file gets added after using a fileInputStream but the registry in the JAR is ruined. The JAR file size is what it should be but the only file showing is the new file's name. How can I preserve the JAR registry?

71. Creating a JAR file to run from command line - Class not found    forums.oracle.com

Hi all I have created a JAR file by using the following command line instructions in DOS: jar cmf C:\Java\manifest.txt test.jar C:\Java\classes The C:\Java\classes location contains my package structure e.g. com\level1\level2\level3\ which contains all the .class files that I am interested in including the class that I want to run which contains the main method: HelloWorld I have specified in the ...

72. how to make .jar file for a multiple class program    forums.oracle.com

I have a code for a chat room that contains two folders , one for Server and one for Client What I need is to create a jar file for the server and a jar file for the clients but here the first problem , I have a file that named (SocketMessengerConstants.class) that is located outside the two folders and is ...

73. Run 2 java class files from Jar file    forums.oracle.com

75. Invoke a Class from a Particular JAR file    forums.oracle.com

I think You can't control this. I've familiar with this problem. If You try to read Sun recomendations it says You that store your classes in packages that reverse of your company domain. Thus You will never find two different java tools( jars ) that have the same package and same class. This problem can be only when You will use ...

76. how to get class file from .jar file    forums.oracle.com

I think you want to call the class from the jar file and use it in your code right? I don't know what kind of IDE you are using but each IDE has its own library configuration. You should include the jars under the library (lib folder) of your project. Then you can call the classes via import.

77. running specific class from jar file?    forums.oracle.com

He Abel, The IndexFiles class does have a main method (according to javadoc), so your last attempt should work. Are both .jar files in the dir you are calling java from? Java doesn't give an error when it cannot find a .jar file so you might have to specify more: "... -cp {path.tojar}/lucene-demos-2.3.2.jar; ...".

78. Help with classes in .jar file    forums.oracle.com

79. How to compare the classes in two jar files?    forums.oracle.com

Dear Chen, What do you mean doesn't work. Is the jar file corrupted in some way? And forgive the obvious question but if you have one that works why not just use it? I suppose if I was trying to figure it out I would extract (many unzip tools will do this or you can use the command line jar tool) ...

80. How to Use the classes that are there in the JAR file    forums.oracle.com

Hi........ I created some java classes (ex: In pacakage java.Auth there are two classes Auth1.java and Auth2.java)i complied those classes and i created the JAR file . Now i want to use the Auth1 class in another program, i imported as <%@ page import="java.auth.*" %> like this but i got the error like:java.lang.NoClassDefFoundError: java/auth/Auth1 plz anybody help me

81. Call class from inside jar file    forums.oracle.com

I have my jar file packed with 4 classes all with main method. I want to call one of those classes but not able to make it. E.g my jar file is test.jar and class name is com.text.main. On the command line i type java com.test.main but I get class not found exception. What am i doing wrong?

82. Removing unused classes from jar file    forums.oracle.com

With that very large caveat, I have written a tool using BCEL that recursively examines classfiles to find external references. There's a slight possibility that I posted the source code here, so you could probably Google for it (if you do, please post a reference to the thread because I'm debating rewriting it).

83. Analyzing classes within a given .jar file    forums.oracle.com

I want to write some code that will take a given .jar file and look through all of the classes defined within and pick out any classes that implement a couple of given interfaces. I've looked at the URLClassLoader class, but I don't really see how to get it to work. Anyone got any ideas?

84. File class in jar    forums.oracle.com

ok I'm writing a game, I want it to be an applet so people can run it straight from my site, without the need to download it. As in many other games, I want to store the best results and display them to the player (I want each player to have its on best results file on his computer. I'm not ...

85. how to get the class file of jar file    forums.oracle.com

86. Usage of External Class from a JAR file    forums.oracle.com

I am writing a JSP page which want to call external defined class from a external JAR file. I want to ask: 1. Where should I place the JAR file? (in the root directory of the JSP or other sub-directory?) 2. How can I include the JAR file into the JSP file? Should I use something like : <%@ page import ...

87. How to get the jar file without knowing its name and any class inside it?    forums.oracle.com

A solution which is a tiny bit less elegant would be to put your version number into a resource in the META-INF directory in the jar, but not actually into the manifest itself. Then you just search for the resource named (e.g.) META-INF/marcos_aps_version using a class which you know to be in the jar, or using the classloader which loaded the ...