问一个JAVA编译的问题

wzg7711 2006-02-25 12:14:40
开发环境是:jdk1.4、resin3.0.8,

C:\jdk1.4\bin>javac D:\resin\web\src\com\pixel\DBConn.java

编译的时候没有发现错误,怎么编译的时候DBConn.class这个怎么和DBConn.java在同一个文件夹呢,而不是在D:\resin\web\WEB-INF\classes\com\pixel文件夹呢,是不是环境变量没有设置好?
...全文
82 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
doway 2006-02-25
  • 打赏
  • 举报
回复
看一下 javac -d 参数
believefym 2006-02-25
  • 打赏
  • 举报
回复
控制台编译显然class文件会和java文件在一个目录下

工程的部署就需要你自己把class和其他相关的包等移到web-inf下面,或者你用ide,自动帮你搞定了
像eclipse编译也顶多帮你把class放到class/package1/package2/XXclass.class
用myeclipse部署就会自动把相关内容移到webapp下(tomcat服务器)
wzg7711 2006-02-25
  • 打赏
  • 举报
回复
C:\jdk1.4>javac -d
javac: -d requires argument
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-O Optimize; may hinder debugging or enlarge class file

-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are us
ed
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧