Windows - Linux, jar-archive problem

I?m programming a project in Eclipse on a WinXP-pc. This project includes some external jar-archives like the mysql-connector. Now I have to run this project on a redhat-linux pc in a shell. Can anybody tell me, where I have to place these jar-files so java and my project will find them?

If I want to compile a file in my project (which is not much more than this single file atm) I have to use javac with the -cp option to specify the location of my external jar, doesn?t I? Yes. Both java and javac need to know the classpath.
Let?s say the file I want to compile is called ApiTest.java. The file and the external jar mysql-connector.jar are placed in the same directory c:\workspace on my windows-machine. Am I right, that the instruction on a command line should look like: "javac -cp c:\workspace\mysql-connector.jar ApiTest.java" executed in c:\workspace?You should include the current directory in the classpath. (with "dot")
javac -cp .;c:\workspace\mysql-connector.jar ApiTest.java
I have the added the mysql-connector.jar to my classpath by using "set classpath=...". But when I try to compile my file, I get the error-message package com.mysql does not exist (com.mysql is the directory-structure in the mysql-connector.jar)... ;(I don't use a CLASSPATH variable. In any case its value is ignored when you set the classpath using -cp. Hence the need to specify the current directory as part of the classpath.
Is there a com.mysql package? I ask because when I use the line "import com.mysql.*;", I get the same error. There is no such package to be found in the version of mysql-connector I am using: mysql-connector-java-5.0.5-bin.jar (512707 bytes).
Putting a similarly named TestApi.java and the jar file into ~/JDC/workspace, here's what I see:
    pbrockway@linuxdeskd6off:~/JDC/workspace$ cat ApiTest.java\\    import java.sql.Connection;\\    import java.sql.DriverManager;
    public class ApiTest {\\        public static void main(String args[]) throws Exception {\\            Class.forName("com.mysql.jdbc.Driver").newInstance();\\            String urlStr = "jdbc:mysql://10.144.32.16/jdc?user=jdcuser&password=jdcpw";\\            Connection con = DriverManager.getConnection(urlStr);\\            System.out.println(con);\\        }\\    pbrockway@linuxdeskd6off:~/JDC/workspace$ javac -cp .:mysql-connector-java-5.0.5-bin.jar ApiTest.java\\    pbrockway@linuxdeskd6off:~/JDC/workspace$ java -cp .:mysql-connector-java-5.0.5-bin.jar ApiTest\\    com.mysql.jdbc.Connection@1113708\\    pbrockway@linuxdeskd6off:~/JDC/workspace$It compiles and runs OK. Things are exactly the same on Windows except that in both cases ; is used rather than : when specifying the classpath.

Similar Messages

  • Jar archive problems........

    Hi, Ive loaded all my files into a jar file, which includes the class files, wav files and images. But the images and wav files are not coming up when i run the html.
    i've run it through the html convertor but still no wav's or images. any solutions?
    thanx

    The HTML Converter only converts HTML, it has nothing to do with jar files.
    You probably have your images in one directory and your classes in another. When you do
    jar -tf mystuff.jar You might get something like this
    images/image1.gif
    images/image2.gif
    waves/wave1.wav
    waves/wave2.wav
    classes/class1.class
    classes/class2.class
    You may need to adjust codebase & archive in your HTML, the way you are populating your jar, and/or your code so they all match.
    This may help
    http://java.sun.com/j2se/1.3/docs/guide/misc/applet.html
    Codebase and archive work the same in APPLET, OBJECT, and EMBED tags.

  • Problems with JApplet, jar-Archive, packages and IE5

    Hello!
    I have a problem with a JApplet and Internet Explorer 5. I made a jar archive of my classes. The classes are
    members of a package. The jar archive also contains images.
    The structure of the archive:
    com/mycomp/myapp/DemoApplication.class
    com/mycomp/myapp/DemoApplet.class
    <more classes>
    com/mycomp/myapp/images/hp_logo.gif
    com/mycomp/myapp/images/test.gif
    <more images>
    The archive is stored locally in a directory which contains also the html file.
    I used the sdk 1.3.1 to compile the classes.
    My problem: when I start the html file on NT with IE5, I get the error message below:
    I try to create a label containing an icon with:
    topLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("images"+fs+"hp_logo.gif")));It works on Sun with Netscape 4.67 and SDK 1.3.1 installed.
    Should I move the images directory inside the jar archive to another place or is the html code not correct?
    The error message:
    java.lang.NullPointerException
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at com.mycomp.myapp.DemoApplication.initComponents(DemoApplication.java:158)
         at com.mycomp.myapp.DemoApplication.<init>(DemoApplication.java:55)
         at com.mycomp.myapp.DemoApplet.<init>(DemoApplet.java:24)
         at java.lang.Class.newInstance0(Native Method)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)The html file:
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
    <html>
      <head>
        <title>DemoApplet</title>
      </head>
      <body>
    <BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#37a1a7">
          <h1>DemoApplet</h1>
          <!--"CONVERTED_APPLET"-->
    <!-- HTML CONVERTER -->
    <SCRIPT LANGUAGE="JavaScript"><!--
        var _info = navigator.userAgent; var _ns = false; var _ns6 = false;
        var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
        var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0)));
        var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
    //--></SCRIPT></COMMENT>
    <SCRIPT LANGUAGE="JavaScript"><!--
        if (_ie == true) document.writeln('<OBJECT classid="clsid:CAFEEFAC-0013-0001-0000-ABCDEFFEDCBA" WIDTH = 695 HEIGHT = 525  codebase="http://java.sun.com/products/plugin/1.3.1/jinstall-131-win32.cab#Version=1,3,1,0"><NOEMBED><XMP>');
        else if (_ns == true && _ns6 == false) document.writeln('<EMBED type="application/x-java-applet;jpi-version=1.3.1"  CODE = com.mycomp.myapp.DemoApplet CODEBASE = "." ARCHIVE = "DemoApplet.jar,classes12.zip" WIDTH = 800 HEIGHT = 600  scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3.1/plugin-install.html"><NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET  CODE = com.mycomp.myapp.DemoApplet CODEBASE = "." ARCHIVE = "DemoApplet.jar,classes12.zip" WIDTH = 695 HEIGHT = 525></XMP>
    <PARAM NAME = CODE VALUE = com.mycomp.myapp.DemoApplet >
    <PARAM NAME = CODEBASE VALUE = "." >
    <PARAM NAME = ARCHIVE VALUE = "DemoApplet.jar,classes12.zip" >
    <PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.3.1">
    <PARAM NAME="scriptable" VALUE="false">
    </APPLET>
    </NOEMBED></EMBED></OBJECT>
    <!--
    <APPLET CODE = DemoApplet CODEBASE = "." ARCHIVE = "DemoApplet.jar,classes12.zip" WIDTH = 695 HEIGHT = 525>
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->
      </body>
    </html>Thank you for your help!
    Gruesse,
    Torsten

    seems like it couldn't find the image file... try to give it the absolute path to the file first to see if this is the root of the problem... and then try to find alternative ways to not give it the absolute path...

  • Windows 8 and CSS problems (FF 16 & 17)

    I just got a brand spanking new Win 8 computer (intl English). The only things installed on it are Adobe Master's Collection, Steam, Office and Firefox. In addition I tried installing adblocker, because that's a must for me and if this problem is resolved by removing it I will have to switch to another browser.
    Now, the problem is that FF is having problems loading pages with CSS. Occasionally, this results in a pages with nothing at all (except background color, it seems) or with just unformatted text. Most of the time this is fixed by doing a shift+reload, but not always. Some times it's just partially fixed and some elements don't load still.
    I've tried disabling all extensions and plugins and I've also tried resetting FF. The problem always comes back. I've even tried resetting my hosts file.
    Do you have any more ways of fixing it? I believe I've done everything in my power, except change browsers (which I really don't want to do unless it's my only option).
    The only thing I haven't tried, which I'll try now, is unpin all my app tabs and see if that fixes anything. I'll update this if I can...
    Pages affected: Facebook (some of the time), Couch Potato (installed on my server - never seen this on other computers or even other browsers on my computer, always), MyFitnessPal (occasionally), and some low-tech dating page I'm on.
    Cheers,
    Lars

    So, it still happens with a new an clean profile without extensions?
    In that case you may have security software (firewall, anti-virus) that block some content.
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Press and hold Shift and left-click the Reload button.
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (MAC)
    You can also try to use the Web Console (Web Developer > Web Console;Ctrl+Shift+K) to see if you can identify network related issues.
    *https://developer.mozilla.org/en/Tools/Web_Console
    *https://developer.mozilla.org/en/Using_the_Web_Console

  • Micro SD crashes entire OS(Mac) but works perfectly on Windows/Linux

    Hello,
    I bought a Micro SD(class 10) card and an adapter that works perfectly(and extremely fast) on Windows/Linux but it doesn't matter the file system scheme that I use with, my Mac will ENTIRELY FREEZE while trying to read/write anything!.
    Tried different adapters and different filesystems(fat32, exfat, ntfs, HFS in all flavors, etc).
    Thanks in advance!

    Ok, no problem with the backup thing.
    But the apps? Will I have to reinstall them all?
    I´ve tryied deleteng the preferences file and restarting, but nothing happens. When I try to manually add an interface on the network preferences, there is no ethernet choice. In terminal, there is no ethernet interface when I call ifconfig, and I cannot ping to another computer.
    I´m verifying/repairing disk permissions right now.

  • Load a file stored in a Jar Archive

    Dear all,
    I have a text file stored in a Jar Archive and I want to obtain a File instance of the text file from the jar file. The reason for this is because I have a method which read in a File instance of the file.
    From my understanding, one can obtain an byte[] array from a file stored in a text file. Is there a way to convert the byte[] into a File instance?
    Thanks.
    Sunny

    Once again, thank you for your prompt response. I agree that one can obtain an inputstream of a file from the Jar archive and work with it. The problem that I am having is that the method that I have is not written by me, to be precise, I am using Syslog and try to read in a configuration file packed in a Jar Archive. The Syslog library only provide a method, which only accept a 'File' instance as an input argument.
    Thanks.
    Sunny

  • What hardware and OS should I prefferably choose for best possible Firefox performace? (Windows/Linux)

    What is the best configuration I should choose for best performance with Firefox?
    Considering OS included also, Windows/Linux,
    as there might be some platform specific accelerations or drivers dependent things.

    If there are problems with updating then best is to download the full version and uninstall the currently installed version and delete the Firefox program folder to remove any leftover files.
    Download a fresh Firefox copy and save the file to the desktop.
    * Firefox 8.0.x: http://www.mozilla.com/en-US/firefox/all.html
    Uninstall your current Firefox version if possible.
    *Do not remove personal data when you uninstall the current version or you lose your bookmarks and other data in the profile folder.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    Your bookmarks and other profile data are stored elsewhere in the Firefox Profile Folder and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup

  • Zip/unzip API for both Windows/Linux

    hello, there:
    I wonder if it's possible that we can create a zip/unzip class that can package the files in Windows and unzip them in Linux?
    Fact is, that I created a Swing application, which shows a tree of a certain folder. Upon request, the app also zip that folder(including it's subs) and upload it to a remote database as a SQL blob. Well, I want this app to work on both Windows/Linux, meaning when it runs on Linux, it should be able to download the package and unzip the package to its full extend.
    But it looks like that the files zipped in one OS can't be easily unzipped to its original in another. Is it doable or not possible due to the very different nature of the file systems of different platform?
    I used a open source code from this link, http://www.wakhok.ac.jp/~tatsuo/sen97/10shuu/UnZip.java.html
    Will the zip package from jdk help (java.util.zip)? I haven't tried that one yet.
    Thanks,
    Sway

    You don't have to use special libraries as the tools you need are all in the java.util package.
    There is however an Apache Commons library for this though which you can find here
    http://commons.apache.org/sandbox/compress/
    Note that zip = archiving and compression where as gz or gzip on Linux is only compression and you would use tar to do the archiving (tar.gz), that's why there are two separate compression classes in the Java API.

  • Creating one jar archive out of several jar archives

    I have a problem with jar files. What i am trying to do is:
    Build one jar archive out of several jar archives. But i always get a ZipException. I opened a JarOutputStream and tried to write JarEntry objects to the stream by using the putNextEntry() method.
    here my code:
    // finalJar is the file to with i want to write
    // final Manifest is the manifest for that jar archive
    try {
    fout = new FileOutputStream (finalJar);
    jout = new JarOutputStream(fout,finalManifest);
    } catch (IOException io) { // log }
    // curJar ... is the current jar archive as JarFile Object
    Enumeration entries = curJar.entries();
    while (entries.hasMoreElements()) {
    JarEntry curEntry = (JarEntry) entries.nextElement();
    try {
    jout.putNextEntry(curEntry);
    } catch (ZipException ze) { // log}
    I get this error: (for every entry the same error !)
    java.util.zip.ZipException: invalid entry size (expected 6010 but got 0 bytes)
    at java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:188)
    at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:116)
    at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:90)
    at GenerateData.createFinalJARArchive(GenerateData.java:361)
    at GenerateData.run(GenerateData.java:87)
    at GenerateData.main(GenerateData.java:72)
    I hope you can help me
    Thanks in advance
    Stefan Siegl

    while((c=in.read())>=0) jout.write(c);I guess you mean with '>' the bigger as '>' char
    .right ?Yes, the "greater than" sign.
    Just a standard stream copying procedure.
    >
    I use your code and set the compression to compressed
    jout.setMethod(ZipOutputStream.DEFLATED);
    jout.setLevel(8);
    jout.putNextEntry(curEntry);
    what i get is this exception:
    java.util.zip.ZipException: invalid entry compressed
    size (expected 787 but got 786 bytes)
    at
    java.util.zip.ZipOutputStream.closeEntry(ZipOutputStrea
    .java:193)
    at
    at
    at
    t
    GenerateData.createFinalJARArchive(GenerateData.java:51
    at GenerateData.run(GenerateData.java:89)
    at GenerateData.main(GenerateData.java:73)
    So there is one byte missing! But i dont know where
    ?!It seems one can't reuse the entry.
    Try to create a new one:
    //jout.putNextEntry(curEntry);
    jout.putNextEntry(new ZipEntry(curEntry.getName()));And I think it's a bad idea to try to change
    the compression level between the entries.
    At list untill you haven't got it working somehow.
    >
    But i finally want to do is to store the entries (and
    the data) uncompressed but if i read byte by byte
    there would not a uncompression, would it ?No. You read the data uncompressed.
    here I also got an exception, indicating that the read
    size was invalid.
    Exception when doing it like this:
    jout.setMethod(ZipOutputStream.STORED);
    jout.setLevel(0);The setLevel(0) is redundant here.
    jout.putNextEntry(curEntry);
    is:
    java.util.zip.ZipException: invalid entry compressed
    size (expected 2805 but got
    6015 bytes)
    at
    at
    at
    t
    java.util.zip.ZipOutputStream.closeEntry(ZipOutputStrea
    .java:193)
    at
    at
    at
    t
    GenerateData.createFinalJARArchive(GenerateData.java:51
    at GenerateData.run(GenerateData.java:89)
    at GenerateData.main(GenerateData.java:73)
    I hope someone can help me with that
    Regards
    Stefan Siegl
    So my variant is:
    jout.setMethod(ZipOutputStream.STORED);
    while (entries.hasMoreElements()) {  
       JarEntry e=(JarEntry) entries.nextElement();  
       //write the appropriate entry to jout
       jout.putNextEntry(new ZipEntry(curEntry.getName()));
       //copy the actual data to jout  
       InputStream currIn=curJar.getInputStream(e);  
       int c;  
       while((c=in.read())>=0) jout.write(c);  
       currIn.close();
    }Hope we finally took over.

  • Accessing multple hard drives on a Mac from Windows + Linux access

    Hi all,
    as listed in my comp details, i have 2 HD's in my PM G5. I also have a PC on my network and i dualboot Windows XP and Ubuntu Linux. Networking with Windows works fine except that i can only share my 160 Gb drive in the Mac, the one which has the system files on it, and most likely my account info. Is there a way to share my other, 250 Gb drive (with its 3 partitions) as well?
    Now, networking with Linux does not work fine... The Mac cannot at all see my PC when im running Linux. Linux sees the Mac, however when i double click the PM G5 icon in my network places folder it is completely empty :/ Im a new Linux user, so i cant do tricks u see. I already posted this topic on the Ubuntu forum but did not get an answer yet.

    Thnx,
    You solved my Windows multiple HD sharing problem with SharePoints. What a wonderful PrefPane...
    However i could not try ur solution to Linux... It doesnt boot ill need to reinstall most likely... But, yes, it does support SMB. May be even NFS, not sure, need to check after reinstall.
    Tnx again, i marked ur answer helpful

  • Windows has encountered a problem communicating with a device connected to my computer

    I have an HP Pavilion dv6 notebook; Product # WF536AV, running Win 7-Home. Without warning, when trying to boot one day I got the following error message: 
    Windows has encountered a problem communicating with a device connected to your computer. May be caused by unplugging removable storage while in use or a faulty hhd or CD drive. An unexpected I/O error. Error Code oxcoooooe9.
    I have a 500GB WDC hhd that seems to run hot.
    Cannot get into F8 Advanced Options, although I can get into BIOS (F9 & F10)
    Ran the Win 7 Recovery Disks twice. No help. Same message
    I can run Linux Ubuntu in memory (not installed). GParted shows the following:    
           Partition size    used       unused   label   flag              file system
    Sda1 76GB       14GB       61GB                                       NTFS
    sda2 400MB     300MB   100MB    SDV     Boot lba      FAT32
    unallocated 390GB
    6. No access to Recovery Manager
    7. F2: memory test passed but hhd test would not run
    8. In Ubuntu Disk Manager, report said drive had 'a few bad sectors', but hhd test would not run "Self Test- Failed (Read)
    9) Ran MBR repair disk and System Rescue disk; no luck
    10) In Ubuntu, when I look at the Windows file system, In 82 GB partition there is an 'RM' folder with an "Image" folder with 16 files.  In the SDV partition is the bootmgr folder and several others
    a) why cannot I boot to Windows off the hhd?
    b) what does SDV label mean (secure digital video; silicon data valu;tr; static driver verifer  from Windows)?
    c) is the hhd simply failing. I do not have an extra to swap out and try
    d) may the Win 7 Recovery disks bad, perhaps, and should I then download a Win 7 ISO file and try that?
    Thanks for any help. This is highly frustrating. I have already spent about 8 hours on this!

    Well, shucks, i just spent almost 30 minutes trying to find your model user guide to explain it better, I guess they never got around to making it.....
    I would just borrow another Windows disk and try installing it again and if it does it again then you might take it to an Apple Store and see if one of the "Genius' " can figure it out.
    Make sure your internet is enabled and click on your blank desktop and at the top of your screen is a Help menu option, enter PRAM and it should give you a list of things relating to Pram. It may take a few seconds to list anything as it has to connect to Apples severs first. It should list the things you may have to fill back in when your done.
    "P-ram" stores some common information that is used in the background, your date, time, startup disk, etc, that you don't have to re-fill when you restart, it's a little different for each computer.

  • Windows主机访问虚拟机linux中的oracle实例的安装方法

    在学习oracle时一般都会在windows中安装虚拟机,在虚拟机安装linux系统并[安装oracle.
    下面是自己的在windows中安装虚拟机并让windows主机能访问虚拟机中oracle实例的安装方法写的不好请大家多多包涵.
    一.准备安装所需要的软件:
    1.VMware虚拟机的下载和安装在我的博客中已经提到,这里就不再详细阐述。
    2.先推荐一个redhat的下载地址,RedHat Linux 5企业版:content.gougou.com/content,
    这个比较全面,但是也比较大(2.68G),如果自己有合适的linux安装版本,可以不使用这个。
    二.在VMware虚拟机为RedHat Linux创建新的虚拟机就不详述了
    三.在新建的虚拟机里安装RedHat Linux就不详述了
    四.在linux系统中安装oracle
    为了创建一个新的oracle用户输入和以下相似的命令:
    # /usr/sbin/useradd -g oinstall -G dba[,oper] oracle
    给oralce用户设置密码
    # passwd oracle
    修改内核参数编辑/etc/sysctl.conf文件
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    fs.file-max = 65536
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default = 262144
    net.core.rmem_max = 262144
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144
    当在/etc/sysctl.conf文件中指定这些内核参数后你要重启系统
    也可以执行以下命令让内核参数生效
    /sbin/sysctl -p
    给oracle用户设置shell限制
    为了提高数据库软件在linux系统中的性能你必须给oracle用户增加以下shell限制:
    shell limit item in limits.confg hard limit
    能打开文件的最大数量 nofile 65536
    单个用户可用的最大进程数 nproc 16384
    在/etc/security/limits.conf文件中增加以下限制:
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536
    在/ect/pam.d/login文件如果下面显示的参数没有就增加到该文件中
    session required pam_limits.so
    根据oracle用户的默认shell,对默认的shell启动文件进行以下更改:
    对于Bourne, Bash, or Korn shell在/etc/profile文件中增加下面的代码
    if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
    else
    ulimit -u 16384 -n 65536
    fi
    fi
    对C shell(csh or tcsh)在/etc/csh.login文件中增加以下代码
    if ( $USER == "oracle" ) then
    limit maxproc 16384
    limit descriptors 65536
    endif
    创建oracle根目录可以输入以下相似的命令:
    # mkdir -p /mount_point/app/oracle_sw_owner
    # chown -R oracle:oinstall /mount_point/app/oracle_sw_owner
    # chmod -R 775 /mount_point/app/oracle_sw_owner
    如果oracle根目录的加载点是/u01并且oracle软件使用者用户为oracle那么oracle根目录的路径为:
    /u01/app/oracle
    [root@weblogic28 ~]# mkdir -p /u01/app/oracle
    [root@weblogic28 ~]# chown -R oracle:oinstall /u01/app/oracle
    [root@weblogic28 ~]# chmod -R 775 /u01/app/oracle
    当你配置oracle用户环境变量时设置ORACLE_BASE时就将oracle根目录的路径赋给ORACLE_BASE
    创建存储数据库文件和数据库恢复文件的目录
    创建存储数据库文件的目录的命令如下:
    # mkdir /mount_point/oradata
    # chown oracle:oinstall /mount_point/oradata
    # chmod 775 /mount_point/oradata
    将存放数据库文件的目录创建在oracle根目录下/u01/app/oracle/oradata
    [root@weblogic28 ~]# mkdir /u01/app/oracle/oradata
    [root@weblogic28 ~]# chown oracle:oinstall /u01/app/oracle/oradata
    [root@weblogic28 ~]# chmod 775 /u01/app/oracle/oradata
    创建oracle Home目录/u01/app/oracle/10.2.0/db
    [root@weblogic28 ~]# mkdir /u01/app/oracle/10.2.0/db
    [root@weblogic28 ~]# chown oracle:oinstall /u01/app/oracle/10.2.0/db
    [root@weblogic28 ~]# chmod 775 /u01/app/oracle/10.2.0/db
    创建存储数据库恢复文件的目录的命令如下:
    # mkdir /mount_point/flash_recovery_area
    # chown oracle:oinstall /mount_point/flash_recovery_area
    # chmod 775 /mount_point/flash_recovery_area
    将存放数据库恢复文件的目录创建在oracle根目录下/u01/app/oracle
    [root@weblogic28 ~]# mkdir /u01/app/oracle/flash_recovery_area
    [root@weblogic28 ~]# chown oracle:oinstall /u01/app/oracle/flash_recovery_area
    [root@weblogic28 ~]# chmod 775 /u01/app/oracle/flash_recovery_area
    创建一个/tmp目录
    [root@weblogic28 ~]# mkdir /u01/tmp
    [root@weblogic28 ~]# chmod a+wr /u01/tmp
    切换到oracle用户来设置环境变量
    [oracle@weblogic28 ~]$
    ls -a
    查看.bash_profile文件
    vi .bash_profile
    TEMP=/u01/tmp
    TMPDIR=/u01/tmp
    export TEMP TMPDIR
    export LD_ASSUME_KERNEL=2.6.9
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/10.2.0/db
    export ORACLE_SID=jycs
    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
    export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    export LD_LIBRARY_PATH
    export PATH=$PATH:$ORACLE_HOME/bin
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
    export CLASSPATH
    [oracle@weblogic28 tmp]$# umask
    0022
    umask命令将会显示22,022或0022
    [oracle@weblogic28 tmp]$# env | more
    REMOTEHOST=10.138.135.242
    HOSTNAME=weblogic28
    SHELL=/bin/bash
    TERM=ansi
    HISTSIZE=1000
    TMPDIR=/u01/tmp
    KDE_NO_IPV6=1
    QTDIR=/usr/lib64/qt-3.3
    QTINC=/usr/lib64/qt-3.3/include
    USER=root
    TEMP=/u01/tmp
    LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;0
    1:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.b
    tm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:
    *.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*
    .bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;3
    5:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
    ORACLE_SID=jycs
    ORACLE_BASE=/u01/app/oracle
    KDEDIR=/usr
    MAIL=/var/spool/mail/root
    PATH=/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:
    /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
    INPUTRC=/etc/inputrc
    上面显示了你所设置的环境变量
    也可以用下面的命令来查看环境变量
    [oracle@weblogic28 tmp]$ echo $ORACLE_HOME[$ORACLE_SID,$ORACLE_BASE]
    将数据库软件包拷贝到linux系统中
    然后解压文件
    $ gunzip filename.cpio.gz
    [oracle@weblogic28 tmp]$ gunzip 10201_database_linux_x86_64.cpio.gz
    执行上面的命令后会出现在 10201_database_linux_x86_64.cpio文件包
    再执行如下命令解压文件
    $ cpio -idmv < filename.cpio
    [oracle@weblogic28 tmp]$ cpio -idmv <10201_database_linux_x86_64.cpio
    database/stage/prereq/db/refhost_Custom.xml
    database/stage/prereq/db/refhost.xml
    database/stage/prereq/db/db_prereq.xml
    database/stage/prereq/db/dbprereq.jar
    database/stage/prereq/db
    database/stage/prereq/oui/knowledgesrc.xml
    database/stage/prereq/oui/rulemap.xml
    database/stage/prereq/oui/OraPrereqChecks.jar
    database/stage/prereq/oui
    database/stage/prereq/common/rulemap.xml
    database/stage/prereq/common
    会出现以上信息
    如果是远程安装可以使用VNC远程连接到linux服务器上来执行界面安装
    1、配置并开启vnc服务
    [oracle@localhost ~]$ vncserver
    You will require a password to access your desktops.
    Password: ---这里要求输入vnc客户端登录的密码并重复
    Verify:
    New 'localhost.localdomain:2 (oracle)' desktop is localhost.localdomain:2
    Creating default startup script. /home/oracle/.vnc/xstartup
    Starting applications specified in /home/oracle/.vnc/xstartup
    Log file is /home/oracle/.vnc/localhost.localdomain:2.log
    ----如上告诉你vnc终端已经创建好,用的是第二个终端
    2、在创建vnc服务的用户目录下会生成一个.vnc的隐藏目录
    [oracle@localhost ~]$ ls -a
    . .bash_profile Disk1 .gconfd .gstreamer-0.10 .metacity README.htm .viminfo
    .. .bashrc .eggcups .gnome .gtkrc-1.2-gnome2 .mozilla .redhat .vnc
    .bash_history .chewing .emacs .gnome2 .ICEauthority .nautilus .scim .Xauthority
    .bash_logout Desktop .gconf .gnome2_private .kde p8202632_10205_Linux-x86-64.zip .Trash .zshrc
    3、进入.vnc目录,找到xstartup可执行文件,用vi 编辑器打开
    [oracle@localhost ~]$ cd .vnc/
    [oracle@localhost .vnc]$ ls
    localhost.localdomain:2.log localhost.localdomain:2.pid passwd xstartup
    [oracle@localhost .vnc]$ vi xstartup
    #!/bin/sh
    # Uncomment the following two lines for normal desktop:
    # unset SESSION_MANAGER
    exec /etc/X11/xinit/xinitrc ---去掉前面的#号即可 --保存退出
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    twm &
    ~
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    "xstartup" 12L, 333C 已写入
    [oracle@localhost .vnc]$ vncserver
    New 'localhost.localdomain:3 (oracle)' desktop is localhost.localdomain:3
    Starting applications specified in /home/oracle/.vnc/xstartup
    Log file is /home/oracle/.vnc/localhost.localdomain:3.log
    4、清除刚才创建的vnc虚拟终端
    [oracle@localhost .vnc]$ vncserver -kill :1
    Can't find file /home/oracle/.vnc/localhost.localdomain:1.pid
    You'll have to kill the Xvnc process manually
    [oracle@localhost .vnc]$ vncserver -kill :2
    Killing Xvnc process ID 11889
    [oracle@localhost .vnc]$ vncserver -kill :3
    Killing Xvnc process ID 11945
    [oracle@localhost .vnc]$ vncserver -kill :4
    Can't find file /home/oracle/.vnc/localhost.localdomain:4.pid
    You'll have to kill the Xvnc process manually
    5、重新建立新的vnc虚拟终端
    [oracle@localhost .vnc]$ vncserver
    New 'localhost.localdomain:2 (oracle)' desktop is localhost.localdomain:2
    Starting applications specified in /home/oracle/.vnc/xstartup
    Log file is /home/oracle/.vnc/localhost.localdomain:2.log --该终端号为 :2
    6、在windows客户端用RealVNC软件中的Run VNC Viewer客户端连接。
    7、在Run VNC Viewer 只需输入linux服务器的地址和刚才生成的终端号:2
    格式:192.168.1.56:2
    8、输入刚才配置vnc服务的时候配的即可登录linux服务器图形界面。
    如果是本地安装的话执行下面的步骤
    用root用户登录
    [root@weblogic28 ~]#xhost + 让任何用户都是启用图形界面
    切换到oracle用户
    [root@weblogic28 ~]su - oracle
    [oracle@localhost ~]$ cd /database
    [oracle@weblogic28 database]$./runInstaller
    设置虚拟机的IP地址让主机可以访问虚拟机
    1、     NAT方式
    1.1     右键单击主机任务栏上的网络连接图标,选择打开网络连接页面
    1.2     启动”VMware Network Adapter VMnet8” 和 “VMware Network Adapter VMnet1”这两个连接
    1.3     右键单击“本地连接”,选择属性,打开”本地连接属性”对话框,选择”高级”标签,打开高级标签页面,选中选项”允许其它网络用户通过此计算机的internet连接来连接”,然后在”家庭网络连接”下拉列表中选择VMware Network Adapter VMnet8。
    1.4     在虚拟机上右键单击你要设置的虚拟机选“setting”(因为有的不止虚拟一台),打开”Hardware”标签页,单击”device”下的ethernet,此时在右边选中NAT:Used to share the host’s IP address. 然后点击确定。
    1.5     打开虚拟机上的Edit菜单,选择virtual network settings打开virtual network editor页面,先打开automatic bridging标签页,关闭automagic bridging,点击应用;再打开DHCP标签页,启动DHCP服务,然后点击应用;最后打开NAT标签页,启动NAT服务,然后点击应用;点击确定后退出
    1.9     启动虚拟机中的系统。
    1.10     设置虚拟机中的系统的IP地址为192.168.100.200,默认网关为192.168.100.1 (VMware Network Adapter VMnet8的IP地址),DNS服务器设置和主机中的DNS服务器一致。
    1.11     重新加载网络参数或者重新启动虚拟机中的系统。
    1.12设置静态IP地址.
    (1).命令行设置(该方式只是临时设置,系统重启后失效)
    [1].设置IP和掩码
    ifconfig 接口名(如eth0) IP地址 netmask 子网掩码
    [2].设置网关
    route add default gw 默认网关
    [3].设置DNS服务器地址
    echo "nameserver DNS服务器地址">/etc/resolv.conf
    实例:假设设置eth0的IP:192.168.1.100,DNS:192.168.1.12
    ifconfig eth0 192.168.100.200 netmask 255.255.255.0
    route add default gw 192.168.100.1
    echo "nameserver=192.168.1.12">/etc/resolv.conf
    (2).修改文件来实现配置网络(需要重启网络接口重启后IP不会改变)
    [1].修改IP地址,文件:/etc/sysconfig/network-scripts/ifcfg-接口名
    这里假设网络接口名为eth0.
    vi /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=eth0 (注:这里填的是网络接口名)
    BOOTPROTO=static
    ONBOOT=yes (注:是否随系统启动)
    IPADDR=192.168.100.200(注:这里填写的是IP地址)
    PREFIX=24 (注:这里填写的是掩码的长度)
    NETMASK=255.255.255.0
    GATEWAY=192.168.100.1( 注:这里写的是网关)就是VMware Network Adapter VMnet8的IP地址
    [2].修改DNS
    echo "nameserver DNS服务器地址">/etc/resolv.conf
    [3].重启网络接口(假设为eth0)
    ifup eth0(注:这里写的是接口名)
    关闭linux防火墙
    (1) 重启后永久性生效:
    开启:chkconfig iptables on
    关闭:chkconfig iptables off
    (2) 即时生效,重启后失效:
    开启:service iptables start
    关闭:service iptables stop
    linux下Oracle自动启动与停止
    1.修改Oracle系统配置文件/etc/oratab
    /etc/oratab 格式为: SID:ORACLE_HOME:AUTO
    把AUTO域设置为Y(大写),只有这样,oracle 自带的dbstart和dbshut才能够发挥作用。我的为:
    $ORACLE_SID:$ORACLE_HOME:Y
    这儿的ORACLE_SID和ORACLE_HOME是oracle用户下的环境变量,在不同的电脑上有不同的值.当你打开/etc/oratab的时候,修改一下就行了.
    2.编写服务脚本
    在/etc/rc.d/init.d目录下创建oracle文件作为启动脚本,内容如下:容如下:
    #!/bin/sh
    #chkconfig: 2345
    #description:oracle_orcl
    # /etc/rc.d/init.d/oracle_orcl
    # auto start database orcl instance
    #set oracle env
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
    export PATH=$PATH:$ORACLE_HOME/bin
    export ORACLE_SID=orcl
    ORACLE_USER=oracle
    #start or stop script
    case $1 in
    start)
    su - "$ORACLE_USER"<<EOO
    lsnrctl start LISTENER
    sqlplus /nolog<<EOS
    connect /as sysdba
    startup
    EOS
    EOO
    stop)
    su - "$ORACLE_USER"<<EOO
    lsnrctl stop LISTENER
    sqlplus /nolog<<EOS
    connect /as sysdba
    shutdown immediate
    EOS
    EOO
    echo "Usage: $0 {start|stop}"
    esac
    在oracle用户下输入如上的内容,然后保存退出,由于是启动脚本,需要执行权限;执行命令chmod a+x oracle授予oracle执行权限.
    3.建立服务连接
    ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc2.d/S99oracle
    ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc3.d/S99oracle
    ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc5.d/S99oracle
    ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc0.d/K01oracle
    ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc6.d/K01oracle
    或可以通过执行以下命令来实现
    chkconfig --add oracle
    chkconfig命令运行成功后,在rc2.d,rc3.d,rc4.d,rc5.d下面建立了S99oracle 连接文件,可以在系统启动的时候,运行脚本启动数据库。在rc0.d、rc1.d和rc6.d目录下面建立了K99oracle文件,用于在系统关闭的时候自动运行脚本关闭数据库。可以使用 chkconfig --list oracle 命令查看服务配置,关于chkconfig更多的用法,可以通过man chkconfig查看
    4.测试
    启动,运行命令:./oracle_linuxdb start
    关闭,执行命令:./oracle_linuxdb stop
    可以用sqlplus user/passward@tnsname来测试启动和关闭数据库是否成功。现在重新启动linux主机,看数据库是否自动启动了.
    这样主机就能访问虚拟机中的oracle数据库了

    其实运用Oracle Virtual Box + OEL会使安装数据库变得更加简便。

  • Sign jar archive

    Hi everybody!
    I hope that's the right forum :)
    I have a jar archive and i wan to sign it with jarsigner. The problem is, that I want to use a certificate and private key, that were not created with keytool.
    Both are in a pkcs12 file.
    Aaaaaaaaaaaand another question: If you change the content of a signed jar archive, the jar will not start anymore? Is that right?
    Thanks for help!

    If you change the content of a signed jar archive, the jar will not start
    anymore? Is that right?You sign a jar to make sure noone changes the content of the jar.
    Changing the content of the jar means you have to resign it.
    To convert your p12 to jks you can have a look at this:
    http://mark.foster.cc/kb/openssl-keytool.html

  • How to extract a jar archive.

    I am in Windows XP SP3,
    using the command line to try and extract a jar archive, to it's present directory:
    jar -xv experiment.jarThe computer just sits there for ages, apparently caught in a loop,
    issuing no output.
    How may I meet with more success?

    Zac1234 wrote:
    jar -xv experiment.jar
    jar -xvf experiment.jar

  • Access wav-files in jar-archives (URL works, File works not)

    Hi there!
    The un-jar-ed application works fine, but I have a problem with accessing files in jar archives.
    URL url = Classname.class.getResource("testdir/test.wav");works fine (and loading images works this way), but as soon as I try to get the file
    File file = new File(url.getFile());I get an null-exception.
    (in my case, I use the jmf package to play the sound-files, and I get the problem when I try to instatiate the MediaLocator
    MediaLocator mediaLocator = new MediaLocator(url);but I think the problem is the same)
    Thanx for help

    works fine Then keep doing it that way. What's the problem? It's true that you can't access something in a jar archive via a File object, so don't do that.

Maybe you are looking for

  • Check cube data

    I have web query that i want to run. It's asking for certain variables eg : date. How can i check cube data to see what valid dates have been posted in the cube? so then I can put this in for the variable date ? thanks

  • Cisco Agent Desktop incorrect stats Agent Statistics Display

    Hi, I have a very strange problem with a cisco agent desktop user. The times/numbers as displayed in the Agent Statistics Display are incorrect. As you can see from image 1, the agent was presented with 14 calls. The total talking time is 7:22. Howev

  • How to remove binding.

    If I set binding in ActionScript like this: BindingUtils.bindProperty(myText, "text", myTI, "text"); How can I break that binding if desired?

  • How to recognize HP 130 printer on Windows 7?

    Macbook Pro-retina does not see the saved folders by Windows 7.

  • How to view photos in icloud?

    Where do  I go tonview photos in icloud storage?