Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6920893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:12:23+00:00 2026-05-27T10:12:23+00:00

The ‘:javap’ command in the scala 2.9.1 console need the tools.jar (from JDK6) in

  • 0

The ‘:javap’ command in the scala 2.9.1 console need the tools.jar (from JDK6) in the ‘classpath’. From cmd-line it could be done with ‘-cp’ argument or CLASSPATH environment variable.

How to do the same for scala console that invoked from SBT with the ‘console’ and ‘console-quick’ commands?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:12:24+00:00Added an answer on May 27, 2026 at 10:12 am

    Long answer, that might help you elsewhere.

    If I want to know about something in SBT, I inspect it:

    > inspect console
    [info] Task: Unit
    [info] Description:
    [info]  Starts the Scala interpreter with the project classes on the classpath.
    [info] Provided by:
    [info]  {file:/home/dcs/github/anti-xml/}default-39679a/compile:console
    [info] Dependencies:
    [info]  compile:compilers(for console)
    [info]  compile:full-classpath
    [info]  compile:scalac-options(for console)
    [info]  compile:initial-commands(for console)
    [info]  compile:streams(for console)
    [info] Delegates:
    [info]  compile:console
    [info]  *:console
    [info]  {.}/compile:console
    [info]  {.}/*:console
    [info]  */compile:console
    [info]  */*:console
    [info] Related:
    [info]  test:console
    

    Ok, there’s an interesting dependency in compile:full-classpath. I wish it were compile:full-classpath(for console), but it isn’t. It shouldn’t cause me trouble in this case, though. Let’s inspect it.

    > inspect compile:full-classpath
    [info] Task: scala.collection.Seq[sbt.Attributed[java.io.File]]
    [info] Description:
    [info]  The exported classpath, consisting of build products and unmanaged and managed, internal and external dependencies.
    [info] Provided by:
    [info]  {file:/home/dcs/github/anti-xml/}default-39679a/compile:full-classpath
    [info] Dependencies:
    [info]  compile:exported-products
    [info]  compile:dependency-classpath
    [info] Reverse dependencies:
    [info]  compile:console
    [info] Delegates:
    [info]  compile:full-classpath
    [info]  *:full-classpath
    [info]  {.}/compile:full-classpath
    [info]  {.}/*:full-classpath
    [info]  */compile:full-classpath
    [info]  */*:full-classpath
    [info] Related:
    [info]  compile:full-classpath(for doc)
    [info]  test:full-classpath
    [info]  test:full-classpath(for doc)
    [info]  *:full-classpath(for console)
    [info]  runtime:full-classpath
    [info]  compile:full-classpath(for console)
    

    Ok, I could go further into the dependencies, but I don’t think it’s necessary. Let’s see what’s inside it:

    > show compile:full-classpath
    [warn] Credentials file /home/dcs/.ivy2/.credentials does not exist
    [info] List(Attributed(/home/dcs/github/anti-xml/target/scala-2.9.1/classes), Attributed(/home/dcs/.sbt/boot/scala-2.9.1/lib/scala-library.jar))
    [success] Total time: 0 s, completed Dec 7, 2011 3:49:30 PM
    

    Ok, nothing unexpected there. Let’s add tools.jar.

    To change something I have to use set, and I have to respect a bunch of camel case and other rules to get it working. If I had compile:full-classpath(for console), that would become fullClasspath in Compile in console. Note the uppercase in Compile, and that full-classpath became fullClasspath, and the general reordering of element names. Details here.

    I think one should be able to take the output of show (or, at least, inspect) and feed it right back to set, but that’s not the case (for now, anyway), so just learn these conversions rules.

    I don’t want to retype everything, just add one JAR file. I need to use += for that. The operators used to change thing can be found here.

    The classpath seems to need some Attributed stuff. Check the detailed docs on Classpath in the SBT wiki, and figure how to come up with one. Fortunately, most values I may want to change aren’t as difficult to create as this one.

    > set fullClasspath in Compile += Attributed.blank(file("/usr/lib/jvm/java-6-sun-1.6.0.26/lib/tools.jar"))
    [info] Reapplying settings...
    [info] Set current project to anti-xml (in build file:/home/dcs/github/anti-xml/)
    

    Seems to have worked. Let’s show its content to confirm, since even writing compile instead of Compile might get it to change the wrong thing.

    > show compile:full-classpath                                                                             
    [warn] Credentials file /home/dcs/.ivy2/.credentials does not exist
    [info] List(Attributed(/home/dcs/github/anti-xml/target/scala-2.9.1/classes), Attributed(/home/dcs/.sbt/boot/scala-2.9.1/lib/scala-library.jar), Attributed(/usr/lib/jvm/java-6-sun-1.6.0.26/lib/tools.jar))
    [success] Total time: 0 s, completed Dec 7, 2011 3:50:07 PM
    

    Yep, there it is. Let’s test it:

    > console
    [warn] Credentials file /home/dcs/.ivy2/.credentials does not exist
    [info] Starting scala interpreter...
    [info] 
    import com.codecommit.antixml._
    bookstore: com.codecommit.antixml.Elem = <bookstore><book><title>For Whom the Bell Tolls</title><author>Hemmingway</author></book><book><title>I, Robot</title><author>Isaac Asimov</author></book><book><title>Programming Scala</title><author>Dean Wampler</author><author>Alex Payne</author></book></bookstore>
    books: com.codecommit.antixml.Zipper[com.codecommit.antixml.Elem] = <book><title>For Whom the Bell Tolls</title><author>Hemmingway</author></book><book><title>I, Robot</title><author>Isaac Asimov</author></book><book><title>Programming Scala</title><author>Dean Wampler</author><author>Alex Payne</author></book>
    Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
    Type in expressions to have them evaluated.
    Type :help for more information.
    
    scala> :javap com.codecommit.antixml.Elem
    Compiled from "node.scala"
    public class com.codecommit.antixml.Elem extends java.lang.Object implements com.codecommit.antixml.Node,com.codecommit.antixml.Selectable,scala.ScalaObject,scala.Product,scala.Serializable{
        public static final scala.Function1 tupled();
        public static final scala.Function1 curry();
        public static final scala.Function1 curried();
        public static final boolean isValidName(java.lang.String);
        public scala.collection.Iterator productIterator();
        public scala.collection.Iterator productElements();
        public java.lang.Object $bslash(com.codecommit.antixml.Selector, com.codecommit.antixml.CanBuildFromWithZipper);
        public java.lang.Object $bslash$bslash(com.codecommit.antixml.Selector, com.codecommit.antixml.CanBuildFromWithZipper);
        public java.lang.Object $bslash$bslash$bang(com.codecommit.antixml.Selector, com.codecommit.antixml.CanBuildFromWithZipper);
        public java.lang.Object select(com.codecommit.antixml.Selector, com.codecommit.antixml.CanBuildFromWithZipper);
        public com.codecommit.antixml.Zipper toZipper();
        public scala.Option prefix();
        public java.lang.String name();
        public com.codecommit.antixml.Attributes attrs();
        public scala.collection.immutable.Map scope();
        public com.codecommit.antixml.Group children();
        public com.codecommit.antixml.Elem canonicalize();
        public java.lang.String toString();
        public com.codecommit.antixml.Group toGroup();
        public com.codecommit.antixml.Group copy$default$5();
        public scala.collection.immutable.Map copy$default$4();
        public com.codecommit.antixml.Attributes copy$default$3();
        public java.lang.String copy$default$2();
        public scala.Option copy$default$1();
        public com.codecommit.antixml.Elem copy(scala.Option, java.lang.String, com.codecommit.antixml.Attributes, scala.collection.immutable.Map, com.codecommit.antixml.Group);
        public int hashCode();
        public boolean equals(java.lang.Object);
        public java.lang.String productPrefix();
        public int productArity();
        public java.lang.Object productElement(int);
        public boolean canEqual(java.lang.Object);
        public com.codecommit.antixml.Elem(scala.Option, java.lang.String, com.codecommit.antixml.Attributes, scala.collection.immutable.Map, com.codecommit.antixml.Group);
    }
    

    Success!!!

    Of course, this session is a lie. It took much longer for me to arrive there, but that’s mostly practice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded PostgreSQL from the official website and ran the .dmg installer. After that
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
I need a function that will clean a strings' special characters. I do NOT
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.