Results 1 to 4 of 4
  1. #1
    coco is offline Member
    Join Date
    Jul 2007
    Posts
    39
    Rep Power
    0

    Default Help with bytecode in java

    Hi, I am wondering if there is an alternative to distributing Java programs with the JVM.

    For instance, I am wondering if anyone has seen a Java compiler that produces machine code rather than bytecode? I've heard of them, but never ever seen them.
    Alternatively, what is the easiest way to make the Java class file seem 'executable'. My Current approach is to use a bat file (or shell script). With the bat file I simply associate my .class files with it and I can then run it by double-clicking the class file containing my main method.

    However, some people find this a bit confusing since they are not used to running .class files. Is there a better way of achieving this?
    Thanks.

  2. #2
    toby is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    If you are supporting Windows, look into converting the program into a .exe file. I can't remember the process exactly(and I'm not at my PC), but a search in java forums(like SUN or another java forum) should point you in the direction.

  3. #3
    Join Date
    Apr 2009
    Posts
    10
    Rep Power
    0

    Default Watermark in java class file

    Hi

    I would like to know how to embed watermark in Java class file and decode that watermark class file to get back the watermark value.

    I will be appreciate if any one can provide the source code.

    I'hv tried many time to get the bytecode of the class file to embed the watermark value but failed. Should i used the class reader to read the class file but where i must to called the class file and how.

    I include some code that i don't know where to get my .class inside this code:

    package test;

    import javax.swing.JOptionPane;

    public class ClassLocationTest {
    public static void main(String[] args) {
    JOptionPane.showMessageDialog(null, getClassLocation(String.class));
    }

    public static String getClassLocation(final Class<?> pClass) {
    final String location, name;
    name = pClass.getName().replaceAll("\\.", "/") + ".class";
    location = ClassLoader.getSystemResource(name).getPath();
    return location;
    }
    }



    I hope any one can help me immediately because i must to submit it next week.



    Thanks you
    Azura

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    Multiposted in various ancient unrelated threads.

    @nur_az2206bad: try again showing a bit of common sense. Start your own thread for your own question. Post it exactly once. And recognise that any urgency is yours and no problem of any one else's.

Similar Threads

  1. differences between bytecode and executable code
    By valery in forum New To Java
    Replies: 2
    Last Post: 04-16-2009, 09:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •