Latest Updates: mac RSS

  • Modify hosts file on Mac

    Ellen 09:35 on October 15, 2010 | 0 Permalink
    Tags: mac

    If you want to make changes to your hosts file on your Mac, go through the following steps:
    1. Open your Terminal window. It is namned Terminal if you search in Spotlight.

    2. Write the following code:

    sudo pico /etc/hosts

    3. The terminal will ask for the admin password to your computer. Hit enter after inputting it.

    4. Make the changes you want to the file. If you want to add a domain and IP number write the following in the file.

    XXX.XXX.XX.XXX http://www.domain.com

    5. Press Ctril + X
    6. And then Y to save!

    terminal

  • Making jar files on Mac

    Ellen 15:34 on January 13, 2010 | 1 Permalink | Reply
    Tags: jar, java, mac, terminal

    jar

    To make a jar file on Mac just first need to open up the Terminal window.
    1. Go to the directory of where your java file is by entering

    cd myDirectory

    2. Compile your java file(myJava.java) into a class

    javac myJava.java

    List the content of the directory to make your the class file has been made

    ls -l

    3. To indicate which function to run first in the jar file we will need to create a text file (MainClass.txt) with the content in the same directory as the java file:

    Main-Class: myJava

    4. The last command to create the actual jar file looks like this:

    jar cmf MainClass.txt myJava.jar *.class

    5. Run your jar file! You can run it by clicking on it or by entering the follwoing command in the Terminal window

    java -jar myJava.jar

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel