- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是项目环境设置的新手。下面是我在eclipse中的项目结构
Project Name
--> .settings
--> .bin
--> lib
--> resources
--> src
--> .classpath
--> .project
我正在尝试将 src 文件夹导出为 jar。
当我导出到 jar 时,上述所有文件夹和文件都会在 jar 中创建。但我只需要将 src 文件夹转换为。
此外,当我导出到可执行 jar 时,所有第三方库都会导出为 jar 中的类文件。对吗?
导出项目的最佳实践是什么。只有 src 文件夹或所有内容。
我需要使用 jar/runnable jar。我的要求是编写启动/停止bat文件来调用jar并执行java程序。
请给我建议。提前致谢。
最佳答案
首先,了解这些文件夹的实际用途很重要。以下是其中几个文件的工作原理。
.settings -> This file records project specific settings and workspace preferences.
.bin -> folder is usually where the compiled files are copied to.
lib -> contains external libraries that are used in your project (like Apache Commons)
resources -> the resources like images, text, pdf, audio, video are usually copied here
src -> the folder where the project's source files are located.
.classpath -> It contains information that the JDT feature needs in order to properly compile the project: the project's source folders, the output folders , and classpath entries.
.project -> This file is maintained by the core Eclipse platform, and its goal is to describe the project from a generic, plugin-independent Eclipse view.
因此您可以看到,如果您排除某些文件,例如 lib、resources、bin 等...您的 jar
文件可能会停止工作。您的 jar
文件需要已编译的文件及其依赖项。
例如:所有编译的 .class
文件都位于 bin
文件夹中。您的 jar
之所以能够工作,是因为这些 .class
文件而不是 src
中的 .java
文件。如果您删除此 bin
文件夹,那么您的 jar
可能会停止工作。
此外,您的项目可能正在使用其他人提供的某些外部库。像 Apache Commons 或 google/guava 一样,它们通常位于 lib 文件夹中。因此您也无法删除该文件夹。
但是,如果您不再希望使用 .java
代码,那么您可以排除由 eclipse 创建的用于管理此项目的文件。请参阅this发布。
另请参阅:
1.What's in an Eclipse .classpath/.project file?
2.exclude files from jar or war in eclipse
关于Java项目环境准备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41711683/
我一直在试图找出为什么这会给我一个错误: PREPARE test FROM 'SELECT t.blah FROM (SELECT ? AS blah) t;'; ERROR 1054 (42S22
我想了解 Go 中的 channel 。我读过默认情况下发送和接收 block ,直到发送方和接收方都准备好。但是我们如何确定发送方和接收方的准备情况。 例如在下面的代码中 package main
大部分的pytorch入门教程,都是使用torchvision里面的数据进行训练和测试。如果我们是自己的图片数据,又该怎么做呢? 1、我的数据 我在学习的时候,使用的是fashion-mnis
在我的 Storyboard中,controller1 有 natigationController 和 segues 到 controller 2。奇怪的是 Segue 工作正常但是 overrid
我正在尝试使用Openshift在线从我的仓库中放入一些代码。 我的构建编译正常,但是部署失败: error: update acceptor rejected nodejs-mongo-persis
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是无关紧要的,
我有一个每晚运行的存储过程。 它从链接服务器中提取一些数据并将其插入到运行 sql 代理作业的服务器上的表中。在运行 INSERT 语句之前,该过程检查链接服务器上的数据库是否联机 (STATE =
我对 PDO 准备好的语句比较陌生。 我忍不住觉得必须有一种更简单、更整洁的方法来执行以下操作:我无论如何都将所有内容加载到一个数组中,然后必须将整个内容重写为一组 ':blah '=>$found[
我正在准备一个 pandas 数据框,用于在 R 的 ggplot2 中绘制带有误差条的图,这需要计算列的统计数据。误差条需要最小值(平均值 - 标准偏差)和最大值(平均值+标准差)。我使用 grou
我的 prepareForSegue 方法没有将数据传递到目标 View Controller 。 var buttonsDictionary = [Int: UIButton]() func cre
需要帮助来完成这个简单的任务。该 sp 应该提供一个结果集,并将从 MS-Access-Database 报告目的中调用。 表名可变,但以数字 (lsid) 结尾。使用串联。max_prepared_
我正在为我工作的小型企业创建销售订单表单。我有一个表单连接到数据库以获取下拉菜单,然后连接到文本框以在需要时添加新数据。如果前面的部分中的所有数据框均已填写,还会出现另外四个部分。 链接到数据库的
以下代码: class Database { (...) public function query($query){ $this->stmt = $this->dbh
我正在开展一个学校项目,涉及一个具有数据库集成的网站。目前正致力于通过它向网站添加新内容(文本、标题、图像)。我已经可以通过网站向数据库添加新用户,但由于某种原因,相同的代码和逻辑不适用于内容。 我注
我如何mysqli::stmt->bind_param在mysql中被视为NULL的东西? 我目前正在使用 $stmt->bind_param('s', 'NULL'); 最佳答案 bind_para
我在此处运行准备 stmt 时遇到语法错误。我尝试手动执行 @c 中的查询并且它有效。不知道为什么 stmt 会给出这个错误。这是我正在使用的代码。 SET @i=24; SET @Bill_mont
已关闭。这个问题是 not reproducible or was caused by typos 。目前不接受答案。 这个问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-top
我想知道准备好的查询是否与未准备的查询一样安全。下面是两个示例,一个用于 SELECT,一个用于 UPDATE。第一行是未准备的查询,第二行是准备好的查询。 选择示例: $userDetails =
我是 ios 开发的新手,在我尝试做的事情上遇到了障碍。 我的方法中有这段代码,旨在将特定的 NSObject 从这个 View 传递到下一个 View ,但是它总是让我的应用程序崩溃。 -(void
自上次调用 segue 以来,我的 UIButton 类的 statValue 属性已更新,但 segue 仍发送旧的原始值。有没有办法刷新 prepare 函数(如下),以便它发送新值? overr
我是一名优秀的程序员,十分优秀!