Petrel_Eclipse_import_export
- 格式:pdf
- 大小:1.11 MB
- 文档页数:18
Eclipse中将项目导出jar包,以及转化成exe文件2011-06-27 09:24一、导出jar文件:如果你的程序开发已经接近尾声了,正准备将其生成桌面可执行文件却不知道该如何操作时,你只要按照以下步骤实行即可:选中你的项目---然后右击弹出选项列表---选择Export---Java---jarfile---next---browser(选择jar的存放路径)---next---next(不管太多继续下一步)---browser(选择你程序的主类--OK)---finish;查看你存放jar的目录,是否已经生成了?如果没有你一定没按照步骤操作.二、运行jar文件:生成的jar文件你可以双击运行它,但默认情况下会以压缩包的方式打开,如果这不是你想要的结果,请右击文件---打开方式---选择java(TM)platform来运行.我想这时你应该看到了你的软件界面.先恭喜你了..三、连同第三方文件一并导出至jar文件:如果你在程序开发的时候用到了第三方提供的API或者其它附属资源,在你导出生成jar文件时你必须将第三方的文件一并导出,不然你的程序运行将达不到你想要的结果.你可以利用Fat jar插件生成jar,Fat jar 的下载地址:/projects/fjep/下载的文件是net.sf.fjep.fatjar_0.0.31.zip,解压缩后你会看到plugins文件夹中的net.sf.fjep.fatjar_0.0.31.jar文件(简称Fat jar).插件安装:把Fat jar文件拷贝到你的eclipse目录下的plugins中..重新启动你的eclipse平台,然后查看Window---preferences,弹出的窗口中有Fat jar preferences这一项则说明你已经安装成功了,没有这一项则未安装成功,需要多做如下几步操作:到你的eclipse目录下的configuration---org.eclipse.update,并删除platform.xml文件,然后重新启动eclipse.查看Window---preferences,你会发现Fat jar preferences这一项.恭喜你安装成功了.(未成功可直接去墙撞死)..用Fat jar打包:右击你的项目,选项列表中有Build Fat jar这一项,选择它,弹出的窗口你会觉得特别亲切,一目了然使用很方便,点击Browser(Main-Class选择你的主类)---next---finish(勾选你需要一起打包的资源,默认为全部勾选).瞧,jar文件就生成在你的工程项目中了.运行它,一切顺利,否则就是你编程的问题了..另:如果你不想用Fat jar来打包,有一个更快捷的方法可以帮助你,但也是有缺陷的.步骤:将你需要用到的附属文件放到你的jre安装目录下的\lib\ext目录中(安装JDK的同时也安装了jre),再通过(一、导出jar文件)的方式生成jar.这样就可以了.它有个致命的缺点就是,这样的jar文件只能在你本机可以使用,如果要在别的机子上运行必需在\lib\ext放置同样的附属资源.四、将jar文件转换成exe可执行文件:exe文件使用方便,而且还可以提高源码及资源的安全性,但同时也失去了java的初衷--跨平台性.如果你坚持要转换成exe文件,请按以下方式进行:利用exe4j这个软件转换jar文件为exe文件,exe4j下载地址:/download/exe4j/files.html,(目前最新版本为4.2)有的需要安装,有的只要解压缩即可用.我一般用安装的exe4j软件,它们没有什么区别,因此找个可以用的就行了.下载安装后,运行它,接着按步骤操作:1.运行后直接点Next.2.选择第二项“JAR in EXE mode”,之后点击Next.3.在General---Short name of your application框中输入你的应用程序的名字(随便即可),在Directories---Output directory框中输入生成exe后的保存路径,然后Next.4.在Excutable name框中输入将要生成的exe的名字,“Icon File”是应用程序显示的小图标,不选也行.继续Next.5.必须先配置Class-Path,点击+号添加文件,即jar文件,如果有用到其它资源需要把资源一起添加进去.6.General --- Main Class选择主类.7.Java Version --- Minimum version(低版本必须填写),Maximum version(高版本可以为空),如果都有填写那么高版本的值必须大于低版本的值.8.勾选Allow JREs with a beta version number以及Only allow JDKs and no JREs.接着Next.到这一步你可以直接finish.这样就把jar转换成exe文件了.你可以点击Click Here to Start the Application 按钮测试生成的文件.到这里就完毕了,对你有没有帮助呢?我想多少解决一些人的烦恼是有的..注意:exe4j是需要注册码激活的,没激活的情况下也可以用,但是在运行生成的exe文件时,会先弹出一个对话框提示该程序是由未注册的软件创建的,提示您激活。
第十二章成果出图成果图件输出的便捷性对报告的组织非常重要,Petrel提供了屏幕拷贝的功能,通过Cut、Paste键,用户可直接将Petrel了中各个窗口的图像干净地插入PowerPoint、Word及Excel中。
Petrel2010允许用户通过内置的SDI - Advanced Printing Solution 来直接输出质量更高的CGM 和PDF,再也不用借助其他插件产生CGM。
平面图窗口(Map Window),截面窗口(Intersection Window)是用于分别产生一个定比的平面图和截面图,线、井、点、层位、断层、属性这些数据都可以显示在绘制的图件上,而Function Window这可以用来绘制各种交会图、散点图、生产曲线图等,这些窗口都可以通过放大或缩小显示或定义显示比例(水平的或垂直的)调整绘制的图件的显示比例,同样也可以加入图头,按照固定的比例直接通过Petrel传送给绘图仪直接打印需要的图件。
Petrel还提供了蒙太奇绘图方式,用户可以把不同图件例如构造图、地震剖面图、直方、油藏剖面图等根据自己的需要在一个窗口里罗列出来,这种方式在制作汇报幻灯片时非常有用。
下面分别来介绍这些各种图件绘制操作。
12.1 绘制平面图(Map Window)操作步骤1)从Windows 菜单下加入打开一个Map 窗口.2)激活一个模型,显示Horizons 文件夹中的一个层(如图12-1)3)显示断层,打开faults filter文件夹选择该层面的断层,4)放大或缩小该图,观察比例尺的变化5)显示井6)打开按钮,人工设置比例尺7)按按钮,加入题头,按右边的黑色箭头改变题头内容8)按按钮旁边的黑色箭头显示网格线9)其他设置功能还有很多,也很简单,用户可以自己练习图12-112.2 测井曲线标签Petrel2010可以在Map窗口中显示高效的井数据。
Log signature是个缩小的well section窗口,其中显示多种井数据,可以将log signature在Map窗口中显示。
eclipse的使用方法总结Eclipse是一款功能强大的集成开发环境(IDE),被广泛用于Java开发和其他编程语言的开发。
它提供了许多工具和功能,使开发人员能够更高效地编写、调试和管理代码。
下面是关于Eclipse使用方法的总结,包括创建项目和其他一些常用操作。
1. 创建项目:- 打开Eclipse,选择File菜单,点击New,然后选择Project。
- 在弹出的对话框中,选择适合你项目类型的选项,比如Java Project或者Dynamic Web Project。
- 输入项目名称和位置,点击Finish完成项目的创建。
2. 导入现有项目:- 打开Eclipse,选择File菜单,点击Import。
- 在弹出的对话框中,选择General -> Existing Projects into Workspace。
- 选择你要导入的项目所在的目录,点击Finish完成项目的导入。
3. 编写和编辑代码:- 在项目资源管理器中选择你要编辑的文件,双击打开。
- Eclipse提供了智能代码补全、语法高亮等功能,可以帮助你更快速地编写代码。
- 可以使用快捷键Ctrl + Space进行代码补全,Ctrl + /注释/取消注释代码块。
4. 调试代码:- 在需要调试的代码行左侧点击添加断点,然后点击Debug按钮启动调试模式。
- 当程序运行到断点处时,程序会暂停,你可以逐行查看代码执行过程,并观察变量的值。
- 可以使用F5进行单步调试,F6进行跳过当前方法,F8继续执行。
5. 运行和测试代码:- 选择要运行的项目或者文件,点击Run按钮,Eclipse会自动编译并执行代码。
- 对于Java项目,可以创建JUnit测试用例来进行单元测试,使用Eclipse内置的JUnit功能进行测试。
6. 版本控制:- Eclipse集成了多种版本控制系统,如Git、SVN等,可以方便地进行代码的版本管理和协作开发。
ExcelImportExport是一个用于在Java应用程序中导入和导出Excel 文件的库。
然而,有时候在使用这个库时,可能会遇到一个错误:“ExcelImportExport could not find zip member”。
这个错误通常发生在尝试导入或导出ZIP文件时。
要解决这个问题,首先需要确保你的ZIP文件中包含一个有效的Excel文件。
你可以使用任何ZIP压缩工具来检查ZIP文件中的内容。
如果ZIP文件中没有有效的Excel文件,那么你需要将正确的Excel文件添加到ZIP文件中,然后再尝试导入或导出。
如果你确定ZIP文件中包含一个有效的Excel文件,但仍然遇到这个错误,那么可能是由于ExcelImportExport库的版本不兼容导致的。
你可以尝试更新ExcelImportExport库到最新版本,或者查看官方文档以获取更多关于兼容性的信息。
此外,还可以尝试使用其他Java库来处理ZIP文件和Excel文件。
例如,Apache POI是一个非常流行的Java库,用于处理Microsoft Office 格式的文件,包括Excel。
你可以使用Apache POI来读取和写入Excel 文件,而不需要使用ExcelImportExport库。
总之,“ExcelImportExport could not find zip member”这个错误通常是由于ZIP文件中缺少有效的Excel文件或版本不兼容导致的。
通过检查ZIP文件中的内容、更新ExcelImportExport库或使用其他Java 库,可以解决这个问题。
ECLIPSE_技巧打开MyEclipse 6.0.1,然后“window”→“Preferences”2. 选择“java”,展开,“Editor”,选择“Content Assist”。
3. 选择“Content Assist”,然后看到右边,右边的“Auto-Activation”下面的“Auto Activation triggers for java”这个选项。
其实就是指触发代码提示的就是“.”这个符号。
4. “Auto Activation triggers for java”这个选项,在“.”后加abc字母,方便后面的查找修改。
然后“apply”,点击“OK”。
5. 然后,“File”→“Export”,在弹出的窗口中选择“Perferences”,点击“下一步”。
6. 选择导出文件路径,本人导出到桌面,输入“test”作为文件名,点击“保存”。
7. 在桌面找到刚在保存的文件“test.epf”,右键选择“用记事本打开”。
8. 可以看到很多配置MyEclipse 6.0.1的信息9. 按“ctrl + F”快捷键,输入“.abc”,点击“查找下一个”。
10. 查找到“.abc”的配置信息如下:如下:11. 把“.abc”改成“.abcdefghijklmnopqrstuvwxyz(,”,保存,关闭“test.epf”。
12. 回到MyEclipse 6.0.1界面,“File”→“Import”,在弹出的窗口中选择“Perferences”,点击“下一步”,选择刚在已经修改的“test.epf”文件,点击“打开”,点击“Finish”。
该步骤和上面的导出步骤类似。
13. 最后当然是进行代码测试了。
随便新建一个工程,新建一个类。
在代码输入switch,foreach等进行测试。
你立即会发现,果然出了提示,而且无论是敲哪个字母都会有很多相关的提示了,很流畅,很方便。
总结:“Auto Activation triggers for java”这个选项就是指触发代码提示的的选项,把“.”改成“.abcdefghijklmnopqrstuvwxyz(,”的意思,就是指遇到26个字母和.,(这些符号就触发代码提示功能了。
eclipse中import用法Eclipse是一个流行的Java集成开发环境(IDE),提供了许多有用的工具和功能,其中包括代码编辑、调试、构建和测试等。
在Eclipse中编写Java代码时,import语句是必不可少的,用于导入Java类库,以便在代码中使用它们的功能。
本文将介绍Eclipse中的import用法。
一、import语句的基本用法在Eclipse中,import语句用于导入Java类库,以便在代码中使用它们的功能。
通常,import语句位于Java文件的顶部,紧随于package语句之后。
根据需要,可以导入不同的包中的类,例如:```javaimportjava.util.*;importjava.io.*;importcom.example.myclass.*;```第一行导入java.util包中的所有类,第二行导入java.io包中的所有类,最后一行导入com.example.myclass包中的所有类。
二、importstatic的用法Eclipse还支持importstatic的用法,这意味着可以直接使用类名而不必使用完整的限定名来调用静态方法或字段。
例如:```javang.Math.PI;```这行代码将导入ng.Math类中的PI静态字段,可以在代码中使用PI而不必使用完整的Math.PI。
三、import的顺序和冲突解决在Eclipse中,import语句的顺序非常重要。
通常,应该按照导入的包顺序放置import语句。
这是因为编译器会按照import语句的顺序查找相应的类。
如果两个import语句导入同一个包中的两个不同的类,并且这两个类具有相同的名称,则编译器会抛出一个错误。
在这种情况下,应该重新组织代码以避免冲突。
四、其他注意事项除了以上提到的基本用法和注意事项外,还有一些其他事项需要注意:1.Eclipse支持自动导入功能,可以根据需要启用或禁用它。
可以在Eclipse的偏好设置中调整此设置。
如何使用Eclipse导入并运行源码作为一名Java开发者,我们经常需要使用Eclipse作为开发工具来写代码,但有时候需要导入别人的源码,这时候我们就需要知道如何正确的导入源码,并且运行起来。
本文将会介绍如何使用Eclipse导入源码,并运行起来。
1. 下载源码首先,我们需要下载源码。
通常情况下,我们可以从开源社区或Github等代码托管平台中下载对应的源码。
在本文中,我们以Spring Framework为例,来说明如何导入源码。
我们需要在Github上先找到Spring Framework项目的源码,可以在Github上面搜索Spring Framework关键字,然后找到spring-projects/spring-framework这个项目即可。
2. 解压源码文件下载下来的Spring Framework源码是一个zip压缩包,我们需要先将其解压缩到一个目录下。
解压后的文件一般会包括一些项目文件、配置文件和源代码文件等。
在本文中,我们将源码解压到名为spring-framework的文件夹中。
3. 在Eclipse中创建一个新的Java项目我们需要在Eclipse中创建一个新的Java项目,来容纳我们刚才解压缩出来的源码。
我们可以按照以下步骤进行:1.打开Eclipse,点击“File” -> “New” -> “Java Project”。
2.在弹出的对话框中,输入项目的名称,比如“spring-framework”。
然后点击“Finish”按钮,Eclipse会自动创建一个新的Java项目。
4. 将源码导入到Eclipse项目中现在我们已经在Eclipse中创建了一个新的Java项目,接下来我们需要将刚才解压缩出来的源码导入到这个项目中。
1.右键点击Eclipse项目的名称,选择“Import”菜单项。
2.在弹出的对话框中,选择“General” -> “File System”,然后点击“Next”按钮。
eclipse基本用法Eclipse是一个开发工具集,主要用于Java开发,但也支持其他语言的开发,如C/C++,Python等。
以下是Eclipse的基本用法:1.创建项目:打开Eclipse后,点击File -> New -> Project,选择想要创建的项目类型,输入项目名称和位置,点击"Finish"按钮即可创建一个新的项目。
2.创建类:在项目中,可以右键点击src文件夹,选择New -> Class,输入类名和所在的包名,点击"Finish"按钮来创建一个新的类。
3.编写代码:在类文件中,可以输入代码来实现具体的功能。
Eclipse提供了代码自动补全、错误提示、代码格式化等功能,可以提高编写代码的效率。
4.调试程序:在Eclipse中,可以设置断点来调试程序。
点击代码行号的区域可以在该行设置一个断点,然后点击Debug按钮运行程序,程序会在断点处暂停,可以逐行执行、查看变量的值等。
5.构建和运行程序:点击工具栏上的Run按钮可以直接运行程序。
Eclipse会自动编译代码并运行程序。
6.导入和导出项目:可以通过右键点击项目-> Import/Export将项目导入或导出到Eclipse中。
7.使用插件:Eclipse支持插件的安装和使用,可以通过Eclipse Marketplace来查找和安装插件,以增加各种功能和工具。
除了以上基本用法,Eclipse还有许多其他的功能和特性,如版本控制、代码重构、界面设计等。
可以根据具体的需求和使用场景进行拓展使用。
同时,Eclipse有一个庞大的社区和生态系统,有大量的插件和扩展可以供开发者使用,可以根据需要来选择和安装。
Schlumberger PublicPetrel-ECLIPSE import-export process - Some tips and some classical pitfallsRecommendation note on Petrel-ECLIPSE1) Petrel-ECLIPSE grid+properties export2) Important remarks3) Petrel property names export rules4) Default values5) ECLIPSE-Petrel grid and property import process6) Petrel/ECLIPSE: importing/exporting faults7) Quality check: illustration8) What could go wrong? Some illustrations1. Petrel-ECLIPSE grid+properties exportYou will find a note on the same topic posted on the Intranet and written in French (by Marie-Laure Baratin):“Procédure de transfert des données du géomodeleur (PETREL/IRAP/GOCAD) vers Eclipse”There are 2 main manual export options:1) Export the grid geometry (and possibly some properties together)2) Export only the grid propertiesSchlumberger PublicWe advise you to check that you are using the following settings for the grid AND for theproperty export:Schlumberger Public2.Important remarksIn order to improve the communication between geologists and reservoir engineers …-Geologists:o you MUST export the grid geometry, the properties and the faults with the SAME settings. We strongly recommend using the “Default ECLIPSE export settings”mentioned above;o be aware of the Petrel property names export rules described below;o be aware that all the exported file names should be in UPPER CASE withoutspace or special characters (to avoid problems under Unix);o Quick QC tests (see illustration in last paragraph):Schlumberger Publicimporting the grid, the faults or the properties back in Petrel will quickly identify if any has been imported with inconsistent settings or if theproperty names are indeed those expected by ECLIPSE;we recommend providing the Reservoir Engineer with a test property (like a porosity) clearly identifiable, or a check with the Reservoir Engineer thevalue and indices of a specific cell; only that test will validate the export!!- Reservoir engineers:o be aware that some keywords like PINCH, ACTNUM or MAPAXES are bydefault present in the exported file (which is not a problem as long as you includethe grid geometry first in the ECLIPSE data deck);o Quick QC tests (see illustration in last paragraph):run ECLIPSE in NOSIM to get the *.EGRID, *.INIT file and *.UNRST and check that the properties and the grid cell indices in FloViz areconsistent with those in Petrel;How does Petrel select the grid origin?Petrel takes the decision on where to locate the grid cell origin at the moment it generates the grid. The grid origin location is always (Xmin, Ymax) but Petrel then follows the “right hand side” rule to define in which direction is going to be the I and J axes, so cell (1,1,1) is the closest to the coordinates origin.What if I want to changes the grid indices for all my filters and for visualization?Because Petrel and ECLIPSE coordinate systems are different, Petrel provides the flexibility to alter the grid indices to facilitate the comparison. This is available through the Project | Project Settings | Misc settings 2 tab:This has NO impact on the export results since, internally, Petrel always refers to the default internal Petrel indices and grid cell origin to export. But to preserve consistency, you should always make sure you have the above settings.Schlumberger PublicWill the export rules always work, even if my grid is rotated?Here is a series of grids all generated in Petrel and exported towards ECLIPSE. If you follow the process, then no matter the rotation, your grid+properties will be successfully exported to ECLIPSE/FloViz with the right indices.Note that we located the default grid origin, the default and swapped cell (1,1) (consistent with FloViz), the I and J axes in Petrel and FloViz for the different angles. We used theECLIPSE/FloViz swapped J axis (project settings described above).Schlumberger PublicIn Petrel, the Z axis is pointing upwards (negative depths) and if you consider the default (pink)cell (1,1) and the internal/original J axis orientation, you will have a “direct” coordinate system(“right hand side rule”).In ECLIPSE, the Z axis is pointing downwards (positive depths) and if you consider the swappedJ index (yellow) cell (1,1) and swapped J index orientation, you also get a “direct system”.So, if you follow the export process with (I=0, J=Jmax, K=0) and always visualize the indiceswith the above project settings (Swap J index on), you will always have an axis coordinatesystem that respects the “right hand side” rule (“direct” coordinate system) as in ECLIPSE.3.Petrel property names export rulesDid you ever notice that the names in the exported files were not always quite those that youexpected?You should be aware that Petrel has some built-in logics around the property templates thatcontrol the exported names:-For some specific property templates, Petrel automatically exports the ECLIPSE name (independently of the Petrel property name or the template name);-For some general property templates , Petrel automatically exports the Petrel property name;-For all the other templates, Petrel automatically exports the Petrel template name;Schlumberger PublicIf you follow those rules, the Reservoir Engineer will be a lot happier!Examples: is exported as “PORO”is exported as “PHIE” is exported as “POROSITY-EFFECTIVE”is exported as “ACTNUM1” if the template is “Region” or “General discrete”(but could be exported as “ACTNUM”, if you have created a new discrete template that you renamed “ACTNUM”; in this case, it is not a general discrete or region template anymore!)4. Default property valuesReplacing a wrong default value in big files is really a pain for the reservoir engineer. This can be avoided if you discuss first with the reservoir engineer. As a first guess, use the recommended default values listed above for the given property type.Note that ECLIPSE does not normally accept region numbers that are negative or 0!In other words, all the region properties should start from 1 for the Reservoir Engineers!!5. ECLIPSE-Petrel grid geometry and property import processThere are 2 main workflows:1) Import ECLIPSE keywords (*.GRDECL format): when grid+properties are in GRDECLformat;2) Import ECLIPSE results (*.EGRID, *.INIT, *.UNRST, …)Schlumberger PublicSome important remarksSchlumberger Public Contrary to the “export” process, the “import” process has no control settings, which means that you must be careful when importing as you could run into potential inconsistencies:- Case 1: you import both EGRID+INIT in Petrel. This is the safest situations since EGRIDand INIT are consistent. No problem here.- Case 2: you already have your grid geometry in Petrel and you import the INIT. If you havenot followed the export process, then you may get some inconsistent properties as Petrel will revert those properties on import and swap the J axis.6. Petrel-ECLIPSE: Exporting/Importing FaultsGeologists: • Be aware that you MUST also keep the SAME export settings as the grid geometry and properties when you export the faults!• Be aware that in ECLIPSE, the fault names cannot contain more than 8 characters! • So please keep track of the Petrel vs ECLIPSE names in the project report and communicate it to the Reservoir Engineer;• In Petrel, it is possible to generate a Fault Index using the “Geometrical Modeling”. You can pass the fault locations with the full names in the project report;Reservoir Engineers:•Be aware that you may need to rename the faults!•When importing the ECLIPSE results in Petrel:o If you turn on the option, Petrel will analyze griddiscontinuities and identify them as “fault 1”, … They may not correspond to theECLIPSE FAULTS keyword at all!o If you turn off the option, Petrel will not generate faultsand you are now able to convert the ECLIPSE FAULTS keyword (and get theECLIPSE fault names in Petrel) as follows:Schlumberger Public7. Quality Check - IllustrationQC for Geologists- Export the grid, faults, properties from Petrel- Import the grid, faults, properties back in Petrel;- Check the new grid location,- Check the new property names (to check if they have the correct ECLIPSE name),, - Check a property value and the cell index on a specific grid cell, for example on a testporosity grid with 2 strikes of porosity = 1 crossing at cell (28,15,1);Schlumberger PublicQC for Reservoir Engineers-Run a NOSIM simulation to get the *.EGRID, *.INIT and *.UNRST files;-Import them in FloViz and/or Petrel;-Check a property value and the cell index on a specific grid cell; (for example, the specific cell (28,15,1) has the right value and right indices in FloViz and Schedule) -Check also the position and orientation of the wells compared to the original data in Petrel;Schlumberger Public8. What could go wrong? Some illustrationsCategory 1: The imported grid seems totally dislocated but all the properties seem good Answer: investigate if MAPAXES is missing when imported back or if you imported with a global coord system a grid that was exported with a local coord systemCategory 2: The grid seems correctly located but the properties are totally strange!Answer: the grid or the properties were exported with different settings.Schlumberger PublicScenario 3: The grid and properties are correctly located, but the faults are totally strange! Answer: the faults were not exported with the same settings as the grid and the properties.Schlumberger Public Scenario 4: The grid and properties are correctly located but the Y axis seems to be inverted in FloViz!!!Answer: Check that the grid and properties were imported with the recommended settings. Here is what happens when you export the grid geometry+properties with a consistently wrong origin! Also, check that the wells have been recomputed with the same grid in Schedule! In this case, we computed the well locations on the original grid, changed the grid export settings “by mistake” and “forgot” to re-run Schedule: the wells are wrongly located on top of the Y axis inversion problem!。