Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: run java class file from independent of OS

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    4
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Question run java class file from independent of OS

    hello to all
    i want to run a java programs (.class file) from system boot .
    i'm java beginner programming , please help me to do this work.
    thank full,

  2. The Following User Says Thank You to starsoheil For This Useful Post:

    davud97 (April 1st, 2010)


  3. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: run java class file from independent of OS

    ... not sure what you mean by running from "system boot". You can run java programs using the following commands:

    java -classpath my_class.class

    note that you must supply the appropriate path for the class (either through relative pathing or absolute pathing).

    To run programs from OS startup is highly dependent on the OS. On windows, I believe it's done by going to the task scheduler (vista or newer), and then telling it to run a task on user login. Ubuntu linux has a gui for which applications should be started at login/startup.

  4. The Following User Says Thank You to helloworld922 For This Useful Post:

    davud97 (April 1st, 2010)

  5. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    4
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: run java class file from independent of OS

    hello
    thank you for your answer
    i want to programming a java boot programs , that means after booting system (no OS) automatically running a java program .
    in fact, i want to know that Java Vitural Machine is running in system boot or no ?

  6. The Following User Says Thank You to starsoheil For This Useful Post:

    davud97 (April 1st, 2010)

  7. #4
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: run java class file from independent of OS

    No, the JVM needs to run with the OS.

  8. The Following User Says Thank You to helloworld922 For This Useful Post:

    davud97 (April 1st, 2010)

  9. #5
    Junior Member
    Join Date
    Mar 2010
    Posts
    4
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: run java class file from independent of OS

    hello
    in fact , i want to programming a simple and small Operating system ,
    i write a few class file . now , i want to this files runing from system boot load.
    please help me that do i this work ?
    and put name of software and books that i need .
    thank full

  10. The Following User Says Thank You to starsoheil For This Useful Post:

    davud97 (April 1st, 2010)

  11. #6
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: run java class file from independent of OS

    This is not possible using Java, you would need to start up some kind of JVM the first thing you do in order to run a Java program and just the fact that you are writing your own OS will probably make everything in the Java SDK not work anyways because Java has been designed and implemented towards certain operating systems.

    Writing your own OS required some ASM and C code, there are some examples out there on how to get your own boot loader to work and how to hook into the interrupts of the keyboard etc.

    Conclusion anyways is that you can just forget about Java if you want to write your own OS.

    // Json

  12. The Following User Says Thank You to Json For This Useful Post:

    davud97 (April 1st, 2010)

  13. #7
    Junior Member
    Join Date
    Mar 2010
    Posts
    4
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: run java class file from independent of OS

    hello
    but i am reading in a book that java can create an Operating System . i want to progranmming this for my thesis.

  14. The Following User Says Thank You to starsoheil For This Useful Post:

    davud97 (April 1st, 2010)

Similar Threads

  1. Calling method from .class file
    By alexx_88 in forum Java Theory & Questions
    Replies: 6
    Last Post: April 24th, 2012, 02:14 AM
  2. How to execute a Java program independent of Netbeans.
    By ShaunB in forum Java Theory & Questions
    Replies: 4
    Last Post: January 19th, 2010, 06:23 AM
  3. Creating a class file
    By ipatch in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 8th, 2009, 07:19 PM
  4. Truncated class file error
    By Koâk in forum Exceptions
    Replies: 4
    Last Post: June 23rd, 2009, 11:23 AM
  5. Reading a file line by line using the Scanner class
    By JavaPF in forum File Input/Output Tutorials
    Replies: 0
    Last Post: April 17th, 2009, 07:34 AM