Results 1 to 12 of 12
Like Tree1Likes
  • 1 Post By Norm

Thread: Create a universal class file

  1. #1
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    88
    Rep Power
    0

    Default Create a universal class file

    My question is pretty simple. Is there a way the create a class file/ java file that you can use outside a project. Just like classes you import like Java.util.Scanner; where can I place my class/java file so that I can reach it to every project I make. I'm creating my own Timer class over and over again and it is really annoying and I really want to use my own. Sorry if this is the wrong section but I didn't know if I should have put it in advanced java or new to java.

    Thanks

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Create a universal class file

    Huh? Just make sure your Timer class is in the classpath and you're done.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    88
    Rep Power
    0

    Default Re: Create a universal class file

    where is the classpath located? how can I find it?

  4. #4
    foulkelore is offline Member
    Join Date
    Dec 2012
    Location
    Des Moines, IA
    Posts
    35
    Rep Power
    0

    Default Re: Create a universal class file

    I believe you want to make a JAR file first. Oracle does have a tutorial for that located here. You might give it a look through.

  5. #5
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    88
    Rep Power
    0

    Default Re: Create a universal class file

    I know how to create a jar file, but is it going to be a runnable or does it even matter. Where should I put it now?

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: Create a universal class file

    Where should I put it now
    put the class file(s) in a jar file and have that jar file be on the classpath for the javac and java commands.
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    88
    Rep Power
    0

    Default Re: Create a universal class file

    and where is the classpath for the javac and java commands located? Is there a usuall place for it like C:/program files/java...?

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: Create a universal class file

    where is the classpath for the javac and java commands located
    Those commands have an option to set their classpath.

    Or some OSs have an environment variable that can be used.
    If you don't understand my response, don't ignore it, ask a question.

  9. #9
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    88
    Rep Power
    0

    Default Re: Create a universal class file

    how can I find it?

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: Create a universal class file

    Google
    foulkelore likes this.
    If you don't understand my response, don't ignore it, ask a question.

  11. #11
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    88
    Rep Power
    0

    Default Re: Create a universal class file

    thanks for the help man...... I don't even know what to google and even if I would I don't understand half of the thing I find. There might be a reason I've put up a thread on this forum...

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: Create a universal class file

    Ask google about your OS: how to add an environment variable.

    Read the doc for the java and javac commands about how to use them:
    Java Platform Standard Edition 7 Documentation
    The java and javac doc have links near the top left in the gray box.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 10
    Last Post: 09-03-2012, 08:13 PM
  2. Universal Password Manager (UPM) 1.8
    By java software in forum Java Software
    Replies: 0
    Last Post: 01-31-2012, 05:18 PM
  3. making a Time class but Universal time always says 0
    By Bravid2001 in forum New To Java
    Replies: 2
    Last Post: 10-24-2011, 07:55 AM
  4. Universal Password Manager 1.7
    By java software in forum Java Software
    Replies: 0
    Last Post: 10-20-2011, 06:27 PM
  5. How to create .exe file using .class file
    By pradnya in forum New To Java
    Replies: 8
    Last Post: 04-18-2009, 12:50 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
  •