Search:

Type: Posts; User: Bent

Search: Search took 0.13 seconds.

  1. Replies
    17
    Views
    5,422

    Re: How to include .ser file into .jar file

    You need to be careful just using user.dir. The user dir can change depending on how the jar is run. If you run from the command line in the jar directory, for example, using java -jar myApp.jar,...
  2. Replies
    17
    Views
    5,422

    Re: How to include .ser file into .jar file

    I did some testing to check it out further. The results were interesting.

    class.getResource returns a a different type of URL depending on whether you're running from a JAR or from a *.class file....
  3. Replies
    17
    Views
    5,422

    Re: How to include .ser file into .jar file

    Well, to get at the problem, we need a get a fix on more details.
    How are you running the JAR?
    What is your classpath when you run it?
    How are you setting the classpath?
    What is your folder...
  4. Replies
    17
    Views
    5,422

    Re: How to include .ser file into .jar file

    As a general rule: If it is in a JAR, it is not a File. You have to use the Class.getResourceAsStream methods to get at it.

    If it is a file, (a REAL file, on your file system, NOT in the JAR) you...
  5. Replies
    17
    Views
    5,422

    Re: How to include .ser file into .jar file

    You've got a lot more difficulty there. From what I understand, JAR files were not intended to be dynamic resource caches, but static ones. There are probably a number of issues but one was that JARs...
  6. Replies
    17
    Views
    5,422

    Re: How to include .ser file into .jar file

    You'll probably want to use the getResourceAsStream method instead of getResource. If I understand it correctly, the file in the JAR doesn't represent a proper file for a File object, so trying to...
  7. Replies
    17
    Views
    5,422

    Re: How to include .ser file into .jar file

    Usually when I have this problem reading files from JARs, it is a character case issue. When you're reading files from disk in windows, the file names are case insensitive. But when you're getting...
Results 1 to 7 of 7