
正文
java自动生成源代码 java 自动生成代码
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
获取java生成exe的源代码
试试直接把扩展名强制弄成是.rar,然后解压,估计这样你就能够看到里面的包以及class等文件了。
= = 我没试过,楼主试试,可以的话顺便告诉我一声,谢谢
相关问答
Q1: 怎样将java源代码生成java应用程序
用命令提示符来生成应用程序
打开命令提示符java自动生成源代码,输入javac 源代码文件路径\源代码文件名称.java 或 javac -jar 源代码文件路径\源代码文件名称.jar
然后就可以看见源代码文件java自动生成源代码的旁边多java自动生成源代码了一个 源代码文件名称.class 文件 或 源代码文件名称.jar
直接用IDE中java自动生成源代码的构建选项 NetbeansIDE 和 eclipse都是现在很受欢迎的IDE
Q2: java代码怎样运行出来?
步骤:
1、在cmd中切换到编写的代码所保存的目录下;
2、在cmd中输入javac然后点空格,再点击文件名和包括后缀名确定后,在存放编写代码的文件下会生成一个class的字节码文件;
3、在cmd中输入java然后点空格,输入第二步中生成的字节码的文件名,不需要后缀名,点击确定即可运行代码。
代码就是程序员用开发工具所支持的语言写出来的源文件,是一组由字符、符号或信号码元以离散形式表示信息的明确的规则体系。计算机代码称为源代码,是相对目标代码和可执行代码而言的。 源代码就是用汇编语言和高级语言写出来的地代码,目标代码是指源代码经过编译程序产生的能被cpu直接识别二进制代码。
Q3: 怎样利用 eclipse mybatis generator 自动生成代码
MyBatis中java自动生成源代码,可以使用Generator自动生成代码,包括DAO层、 MODEL层 、MAPPING SQL映射文件。
第一步java自动生成源代码:下载MyBatis的Generator工具
htt p:/ /mybati s.gith ub.i o/generator/
第二步:配置自动生成代码所需的XML配置文件,例如(generator.xml)
将这个文件保存至你下载的mybatis-generator-core-1.3.2文件夹下
第三步:进入XML配置文件(generator.xml)所在的的目录并执行命令:
Dos代码
java -jar E:\mybatis-generator-core-1.3.2\lib\mybatis-generator-core-1.3.2.j ar -configfile generator.xml -overwrite
mybatis generator eclipse插件的安装
打开eclipse,点击HelpSoftware Update
选择 "Available Software" 标签,点击 "Add Site" 按钮
输入以下信息:
Location:htt p:/ /mybatis.googleco de.c om/svn/sub-projects/gen erator/trunk/eclipse/UpdateSite/
点击ok,自动进入"mybatis generator Feature"
点击“install”按钮进行安装。。。。mybatis generator 插件安装完成
配置Mybatis Generator不要生成Example类
Mybatis Generator默认设置会生成一大堆罗哩罗嗦的Example类,主要是用各种不同的条件来操作数据库,大部分是用不到的,用到的时候手工修改mapper和接口文件就行java自动生成源代码了。
/codetable
schema="general"
tableName="tb_table_name"
domainObjectName="EntityName"
enableCountByExample="false"
enableUpdateByExample="false"
enableDeleteByExample="false"
enableSelectByExample="false"
selectByExampleQueryId="false"
name="useActualColumnNames"
value="true"/
//codetable
这样生成的mapper和dao接口就清爽多了。
Q4: java代码生成器怎么用
zip包java自动生成源代码,然后自动下载下来
1.预先定义好模板
2.界面输入相关参数
3.解析模板生成代码并下载
最后放出源代码java自动生成源代码:
package com.et.controller.system.createcode;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.et.controller.base.BaseController;
import com.et.util.DelAllFile;
import com.et.util.FileDownload;
import com.et.util.FileZip;
import com.et.util.Freemarker;
import com.et.util.PageData;
import com.et.util.PathUtil;
/**
* 类名称:FreemarkerController
* 创建人:Harries
* 创建时间:2015年1月12日
* @version
*/
@Controller
@RequestMapping(value=”/createCode”)
public class CreateCodeController extends BaseController {
/**
* 生成代码
*/
@RequestMapping(value=”/proCode”)
public void proCode(HttpServletResponse response) throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
/* ============================================================================================= */
String packageName = pd.getString(“packageName”); //包名 ========1
String objectName = pd.getString(“objectName”); //类名 ========2
String tabletop = pd.getString(“tabletop”); //表前缀 ========3
tabletop = null == tabletop?””:tabletop.toUpperCase(); //表前缀转大写
String zindext = pd.getString(“zindex”); //属性总数
int zindex = 0;
if(null != zindext !””.equals(zindext)){
zindex = Integer.parseInt(zindext);
}
ListString[] fieldList = new ArrayListString[](); //属性集合 ========4
for(int i=0; i zindex; i++){
fieldList.add(pd.getString(“field”+i).split(“,fh,”)); //属性放到集合里面
}
MapString,Object root = new HashMapString,Object(); //创建数据模型
root.put(“fieldList”, fieldList);
root.put(“packageName”, packageName); //包名
root.put(“objectName”, objectName); //类名
root.put(“objectNameLower”, objectName.toLowerCase()); //类名(全小写)
root.put(“objectNameUpper”, objectName.toUpperCase()); //类名(全大写)
root.put(“tabletop”, tabletop); //表前缀
root.put(“nowDate”, new Date()); //当前日期
DelAllFile.delFolder(PathUtil.getClasspath()+”admin/ftl”); //生成代码前,先清空之前生成的代码
/* ============================================================================================= */
String filePath = “admin/ftl/code/”; //存放路径
String ftlPath = “createCode”; //ftl路径
/*生成controller*/
Freemarker.printFile(“controllerTemplate.ftl”, root, “controller/”+packageName+”/”+objectName.toLowerCase()+”/”+objectName+”Controller.java”, filePath, ftlPath);
/*生成service*/
Freemarker.printFile(“serviceTemplate.ftl”, root, “service/”+packageName+”/”+objectName.toLowerCase()+”/”+objectName+”Service.java”, filePath, ftlPath);
/*生成mybatis xml*/
Freemarker.printFile(“mapperMysqlTemplate.ftl”, root, “mybatis_mysql/”+packageName+”/”+objectName+”Mapper.xml”, filePath, ftlPath);
Freemarker.printFile(“mapperOracleTemplate.ftl”, root, “mybatis_oracle/”+packageName+”/”+objectName+”Mapper.xml”, filePath, ftlPath);
/*生成SQL脚本*/
Freemarker.printFile(“mysql_SQL_Template.ftl”, root, “mysql数据库脚本/”+tabletop+objectName.toUpperCase()+”.sql”, filePath, ftlPath);
Freemarker.printFile(“oracle_SQL_Template.ftl”, root, “oracle数据库脚本/”+tabletop+objectName.toUpperCase()+”.sql”, filePath, ftlPath);
/*生成jsp页面*/
Freemarker.printFile(“jsp_list_Template.ftl”, root, “jsp/”+packageName+”/”+objectName.toLowerCase()+”/”+objectName.toLowerCase()+”_list.jsp”, filePath, ftlPath);
Freemarker.printFile(“jsp_edit_Template.ftl”, root, “jsp/”+packageName+”/”+objectName.toLowerCase()+”/”+objectName.toLowerCase()+”_edit.jsp”, filePath, ftlPath);
/*生成说明文档*/
Freemarker.printFile(“docTemplate.ftl”, root, “说明.doc”, filePath, ftlPath);
//this.print(“oracle_SQL_Template.ftl”, root); 控制台打印
/*生成的全部代码压缩成zip文件*/
FileZip.zip(PathUtil.getClasspath()+”admin/ftl/code”, PathUtil.getClasspath()+”admin/ftl/code.zip”);
/*下载代码*/
FileDownload.fileDownload(response, PathUtil.getClasspath()+”admin/ftl/code.zip”, “code.zip”);
}
}
Q5: 编写intellij idea 自动生成代码java.ft 怎么编辑
1、选择“Create New Project”
2、选择Javajava自动生成源代码,然后点击Next
3、点击Next
4、填写项目名java自动生成源代码,然后点击Finish
5、在“src”目录上右击java自动生成源代码,选择“New”-“Java Class”
6、填写类名java自动生成源代码,然后点击OK
7、程序写完后点击绿色的箭头
8、选择第一项
9、完成。程序的输出显示在屏幕下方
关于java自动生成源代码和java 自动生成代码的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。




