The Artima Developer Community
Sponsored Link

Java Buzz Forum
Saturday Java Quiz: Know Your javac Command

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Saturday Java Quiz: Know Your javac Command Posted: Aug 2, 2008 6:15 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Saturday Java Quiz: Know Your javac Command
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

Yesterday at lunch, I asked Charles: "It's Friday today, isn't it?" Charles said back: "That's sad."

Sadder still, even after the Friday-ness was confirmed, it didn't occur to me that I have been negligent of my Friday Java Quiz duties for two weeks in a roll.

So here goes, a day late, but just as punishing and irrelevant.

The set up: You have the Sun JDK (or OpenJDK) installed with javac and friends in your $PATH. You do not have $CLASSPATH set. And you have a bunch of jar files sitting in a directory, say, /usr/share/java. And you have written a class Foo.java in your home directory that uses a class in one of the jar files.

Q: Which of the following commands will successfully compile Foo.java:

  1. javac Foo.java
  2. export CLASSPATH=`echo /usr/share/java/* | tr ' ' :` ; javac Foo.java
  3. javac -classpath ".:/usr/share/java/*" Foo.java

You are allowed to check the man page for javac, but don't start to try out the commands before you have read the man page.

The command shown are Linux commands and as shown, won't work on Windows. Windows users should try the Windows equivalents of the above.

Read: Saturday Java Quiz: Know Your javac Command

Topic: 5 Good Software Related Podcasts (Summer 2008) Previous Topic   Next Topic Topic: What Do You Do When You Don't Have Ideas To Blog About?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use