scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

Support Javap

Open He-Pin opened this issue 3 months ago • 5 comments

Support Javap otherwise, I have to

scala-cli compile X.java -p

and then

javap -c .....very long path ....class

He-Pin avatar Sep 19 '25 07:09 He-Pin

But wait, what exactly would you like to have here? javap as a new sub-command? what about scalap? Any context on motivation/usecase? is it just for convenience, so that you don't have to run it in 2 commands?

I suppose at the very least scalap would make sense, as we already have scaladoc...

Gedochao avatar Sep 19 '25 10:09 Gedochao

is it just for convenience, so that you don't have to run it in 2 commands?

the biggest pain point is that I have to figure out what long path to pass to the second command:

% echo 'class C' > C.scala
% scala compile C.scala
Compiling project (Scala 3.7.3, JVM (21))
Compiled project (Scala 3.7.3, JVM (21))
% javap -classpath .scala-build/20250919_73d54800d9-854bc8c0b8/classes/main C
Compiled from "C.scala"
public class C {
  public C();
}
% 

SethTisue avatar Sep 19 '25 15:09 SethTisue

Btw. you can easily run that in Metals via the command metals.show-javap-verbose and similar. Also available under right click in the Metals Analyse menu

tgodzik avatar Sep 19 '25 16:09 tgodzik

@tgodzik Thanks, I'm A java developer, and using IDEA :(, does Metals support the Scala Maven plugin? We are using Maven at work.

He-Pin avatar Sep 19 '25 18:09 He-Pin

It should support Maven, but how do you mix it with Scala CLI actually, since this feature request is about it?

tgodzik avatar Sep 22 '25 08:09 tgodzik