Java and system registry

where can i learn everything there is to know about a system registry of a computer. any websites that give detailed information on this issue?
Is there a java class which i can use to access the system registry and make changes to it. for the time being, assume i have admin access to a system.
i am new to this forum. just joined. so pls xcuse me if i have done anything i am not supposed to or in any way not followed any rules while posting this question.
thank you
Edited by: avi.cool on May 28, 2008 6:14 PM

avi.cool wrote:
where can i learn everything there is to know about a system registry of a computer.Computers don't have registries. A type of operating system has a registry.
any websites that give detailed information on this issue?I don't know. What did google suggest?
Is there a java class which i can use to access the system registry Not really no. You should use Google to search for something. You'll need native code and it will only work on Windows.
and make changes to it. for the time being, assume i have admin access to a system.Regardless this does not seem like a very good idea for a Java project at all. Why do you feel you want to do this? If you want to make a Windows registry editor you would be better off doing it C# or something.
i am new to this forum. just joined. so pls xcuse me One thing that is strongly encouraged here is for posters to use real words. So write please and pls, plz or the ever popular plzzzzzzzzzzzz for example.

Similar Messages

  • How to access system registry through java program

    Friends
    I have to access System registry of Windows 2000 by Java program. I don't know how to access the registry by using java code. Please help me. Else
    I want to create a setup file for my application. before setup my application i have to check whether the system has JVM or not. If its not then i have to install JVM first and then my application. so i need to access system registry. please give me a solution for this.
    Thanks in advance
    Ramesh

    I don't know how to access the registry
    by using java code. You can't, without using a native interface (JNI type) library.
    This is one, there are others, do a Google search:
    http://www.bayequities.com/tech/Products/jreg_key.shtml

  • Where I can find and use "Java Desktop System Management Tools "

    With Solaris 10, you not only get the Java Desktop System desktop environment, but also the Java Desktop System Management Tools and a selection of free and trial Development Tools, which are available for download only.
    I found only an information about JDS release 2
    but today it's release 3 already and it's said it already integrated in JDS
    and above sentence it state that it already come with solaris 10?
    where i can find that , where i can use it
    http://docs.sun.com/app/docs/doc/817-7575/6mmsrpduj?a=view
    this page said how to install but ...where I can find CD/
    regards please help

    Good question. It appears to have been installed with Solaris 11/06, as I have all of the packages listed here:
    http://docs.sun.com/app/docs/doc/817-7575/6mmsrpdus?a=view
    However, it does not appear in the Java Web Console. I tried adding it using the wcadmin command, but haven't managed to get it to run as per the docs. The documentation assumes that it is already installed and visible in the Java Web Console...
    According to this documentation:
    http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5l6?a=view#gdjpi
    An application for the Java Web Console should have a WEB-INF directory and an app.xml file. The apoc packages come with neither, so something is missing.

  • Java.lang.system and InputStream

    java.lang.system has 3 fields defined:
    static PrintStream err;
    static InputStream in;
    static PrintStream out;
    As InputStream is a abstract class, can it be used to declare a variable? If so, how to instantiate?
    Thanks

    java.lang.system has 3 fields defined:
    static PrintStream err;
    static InputStream in;
    static PrintStream out;
    As InputStream is a abstract class, can it be used to declare a variable? If so, how to instantiate?You cannot create an object from an abstract class; you can create an object from a sub class of
    that abstract class, and that's exactly what that Stystem.in is refering to, an object from a sub
    class of the abstract class InputStream. This sub class still IS-A Inputstream and all you have
    to know that it behaves exacty as an InputStream.
    Think of it this way -- 'birds' by themselves do not exist; sparrows exist and parrots and penguins exist.
    Still you can point to a penguin and say "hey! That's a bird". And so is the object refered to by the
    System.in variable an InputStream.
    kind regards,
    Jos

  • The performance of management system with Java and MySQL

    Hi all,
    I want to develop one management application with Java and MySQL. However I am not sure which is a good way to design the system. The system has to deal with customers' data in the database.
    Should I create objects for every customers when application starts so that I do not need to access to the database often? Or
    Should I access to the database everytime the user want to deal with customer's data?
    Welcome for any suggestion.
    Thank you
    Pat

    Hi
    i i think u should go through MVC model or use connection pooling

  • I have a MAC, Ive just installed OS10.10.3 operating system in it and I can't open Photoshop.  This is a wide spread problem that involves Java and Photoshop software.  Since you produce both these products , I turn toward you to direct me to the best "Fi

    I have a MAC, Ive just installed OS10.10.3 operating system in it and I can't open Photoshop.  This is a wide spread problem that involves Java and Photoshop software.  Since you produce both these products , I turn toward you to direct me to the best "Fix"?

    Go here Mac OS X Yosemite (10.10) compatibility FAQs | CC

  • Java and the embedded system

    Dear readers,
    I'm having a project in mind about developing an embedded system and I want to use the flexibility of java to implement it . I'm new to the embedded system, so please try to guide me and recomend me websites as much as you can.
    Thanks in advance

    brahim wrote:
    Dear readers,
    I'm having a project in mind about developing an embedded system and I want to use the flexibility of java to implement it . I'm new to the embedded system, so please try to guide me and recomend me websites as much as you can.[www.google.com|http://www.google.com/search?hl=en&q=java+embedded+system] is a good start.
    Thanks in advanceNo problem.

  • 11.1.2.3 Essbase Admin Server  stopped ??? where is the EPM System Registry located

    Whereis the Location of the EPM System Registry  !!!!
    I have complete the .3 install and config of essbase and Planning completely set planing, made a snapshot of my VMware system  and shut down the server
    this morning logon to my Laptop Started EPM system
    and now my Essbase Administation Server
    EPM System Registry configuration.r  / Localhost:900  = Stopped
    I Restarted my EPMSystem then
    stop and started  Essbase Administation Server
    but it is stated it was stopped
    went to
    Oracle\Middleware\user_projects\epmsystem1\diagnostics\logs\essbase\essbase/Essbase
    [Wed Jan 08 06:39:17 2014]Local/ESSBASE0///6996/Error(1051683)
    Attempt to retrieve connection information from the registry failed. Please check reg.properties file and try again.
    and
    COracle\Middleware\user_projects\epmsystem1\diagnostics\logs\essbase\essbase/Essbase_odl
    [2014-01-08T06:39:17.203-05:00] [EPMCSS] [ERROR] [EPMCSS-00001] [oracle.EPMCSS.CSS] [tid: 10] [ecid: disabled,0] [SRC_CLASS: com.hyperion.css.registry.RegistryManager] [SRC_METHOD: RegistryManager] Failed to initialize EPM Shared Services security instance. Component SYSTEM9/FOUNDATION_SERVICES_PRODUCT/SHARED_SERVICES_PRODUCT is null in EPM System Registry. Verify EPM System Registry configuration.
    LOOK AS IF THERE IS A ISSUE WITH THE  EPM System Registry
    Oracle EPM System
    Diagnostics
    everything Failed ??
    Hyperion Foundation
    FAILED Audit Validating that Audit has been initialized
    Error: Checker execution failed.
    Recommended Action: Refer to the validation logs for exception details.
    4 seconds
    FAILED CES Validating that CES has been initialized
    Error: Checker execution failed.
    Recommended Action: Refer to the validation logs for exception details.
    4 seconds
    WARNING CFG: Configuration Validating that configuration tasks have been completed
    EPMVLD-01004: The following configuration tasks have not been completed:
    Configure Web Server: Pending
    Configure Database: Pending
    Configure: Pending
    Configure Common Settings: Pending
    Configure Oracle Configuration Manager: Pending
    0 seconds
    FAILED CSS Validating that CSS has been initialized
    Error: Checker execution failed.
    Recommended Action: Refer to the validation logs for exception details.
    4 seconds
    FAILED EXT: External Authentication Checker execution failed.
    Error: EPMCSS-00000: Failed to process request. Internal server error. Refer EPM Shared Services Security log file for related errors.
    Recommended Action: Refer to the validation logs for exception details.
    8 seconds
    FAILED HUB Validating that HUB has been initialized
    Error: Checker execution failed.
    Recommended Action: Refer to the validation logs for exception details.
    4 seconds
    PASSED WEB: Permissions All HIT entries are present in system-jazn-data.xml
    0 seconds
    FAILED LCM Validating that LCM has been initialized
    Error: Checker execution failed.
    Recommended Action: Refer to the validation logs for exception details.
    4 seconds
    FAILED Single Sign-On Checker execution failed.
    Error: Checker execution failed.
    Recommended Action: Refer to the validation logs for exception details.
    2 seconds
    FAILED LNK: Registry Checking that all components in the registry have a link to host
    Error: Checker execution failed.
    Recommended Action: Refer to the validation logs for exception details.
    0 seconds
    PASSED CFG: Environment Checking whether system path variable length exceeds 2,000
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component SHARED_SERVICES_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    FAILED Registry Validating that Registry has been initialized
    Error: Checker execution failed.
    Recommended Action: Refer to the validation logs for exception details.
    4 seconds
    EPM System Registry
    Essbase / Essbase
    WARNING CFG: Configuration Validating that configuration tasks have been completed
    EPMVLD-01004: The following configuration tasks have not been completed:
    Configure Essbase Server: Pending
    Register with Shared Services: Pending
    Configure: Pending
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component ESSBASE_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    Essbase / Essbase Administration Services
    WARNING CFG: Configuration Validating that configuration tasks have been completed
    EPMVLD-01004: The following configuration tasks have not been completed:
    Configure Database: Pending
    Register with Shared Services: Pending
    Configure: Pending
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component ESSBASE_ADMINISTRATION_SERVICES_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component ESSBASE_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    Essbase / Essbase Integration Services
    WARNING CFG: Configuration Validating that configuration tasks have been completed
    EPMVLD-01004: The following configuration tasks have not been completed:
    Configure Essbase Integration Services: Pending
    Configure: Pending
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component ESSBASE_INTEGRATION_SERVER_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component ESSBASE_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    Essbase / Essbase Studio
    WARNING CFG: Configuration Validating that configuration tasks have been completed
    EPMVLD-01004: The following configuration tasks have not been completed:
    Configure Database: Pending
    Register with Shared Services: Pending
    Configure: Pending
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component ESSBASE_STUDIO_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component ESSBASE_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    Essbase / Provider Services
    WARNING CFG: Configuration Validating that configuration tasks have been completed
    EPMVLD-01004: The following configuration tasks have not been completed:
    Configure: Pending
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component ESSBASE_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    Foundation / Calculation Manager
    WARNING CFG: Configuration Validating that configuration tasks have been completed
    EPMVLD-01004: The following configuration tasks have not been completed:
    Configure Database: Pending
    Register with Shared Services: Pending
    Configure: Pending
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component CALC_MANAGER_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    Foundation / Performance Management Architect
    FAILED AppMgrLoadAdf Launch external checker with next command: C:\Oracle\Middleware\EPMSystem11R1\..\jdk160_35/bin/java -DEPM_ORACLE_HOME=C:\Oracle\Middleware\EPMSystem11R1 -DEPM_ORACLE_INSTANCE=C:\Oracle\Middleware\user_projects\epmsystem1 -Djava.util.logging.config.class=oracle.core.ojdl.logging.LoggingConfiguration -Doracle.core.ojdl.logging.config.file=C:\Oracle\Middleware\user_projects\epmsystem1\config\validation\11.1.2.0\validationTool-logging.xml com.oracle.epm.epma.config.validations.appmanager.AppMgrLoadAdf
    Error: AppMgrLoadAdf failed on initialization. Please check all registry information is valid and that HSS is running.
    Recommended Action: Make sure external checker is working.
    9 seconds
    WARNING CFG: Configuration Validating that configuration tasks have been completed
    EPMVLD-01004: The following configuration tasks have not been completed:
    Create EPMA Virtual Directory: Pending
    Configure Database: Pending
    Register with Shared Services: Pending
    Configure: Pending
    0 seconds
    FAILED DimEditorLoadAdf Launch external checker with next command: C:\Oracle\Middleware\EPMSystem11R1\..\jdk160_35/bin/java -DEPM_ORACLE_HOME=C:\Oracle\Middleware\EPMSystem11R1 -DEPM_ORACLE_INSTANCE=C:\Oracle\Middleware\user_projects\epmsystem1 -Djava.util.logging.config.class=oracle.core.ojdl.logging.LoggingConfiguration -Doracle.core.ojdl.logging.config.file=C:\Oracle\Middleware\user_projects\epmsystem1\config\validation\11.1.2.0\validationTool-logging.xml com.oracle.epm.epma.config.validations.dimeditor.DimEditorLoadAdf
    Error: DimEditorLoadAdf failed on initialization. Please check all registry information is valid and that HSS is running.
    Recommended Action: Make sure external checker is working.
    9 seconds
    FAILED EnumApplications Launch external checker with next command: C:\Oracle\Middleware\EPMSystem11R1\..\jdk160_35/bin/java -DEPM_ORACLE_HOME=C:\Oracle\Middleware\EPMSystem11R1 -DEPM_ORACLE_INSTANCE=C:\Oracle\Middleware\user_projects\epmsystem1 -Djava.util.logging.config.class=oracle.core.ojdl.logging.LoggingConfiguration -Doracle.core.ojdl.logging.config.file=C:\Oracle\Middleware\user_projects\epmsystem1\config\validation\11.1.2.0\validationTool-logging.xml com.oracle.epm.epma.config.validations.repository.EnumApplications
    Error: EnumApplications failed on initialization. Please check all registry information is valid and that HSS is running.
    Recommended Action: Make sure external checker is working.
    9 seconds
    FAILED EnumDataSyncs Launch external checker with next command: C:\Oracle\Middleware\EPMSystem11R1\..\jdk160_35/bin/java -DEPM_ORACLE_HOME=C:\Oracle\Middleware\EPMSystem11R1 -DEPM_ORACLE_INSTANCE=C:\Oracle\Middleware\user_projects\epmsystem1 -Djava.util.logging.config.class=oracle.core.ojdl.logging.LoggingConfiguration -Doracle.core.ojdl.logging.config.file=C:\Oracle\Middleware\user_projects\epmsystem1\config\validation\11.1.2.0\validationTool-logging.xml com.oracle.epm.epma.config.validations.repository.EnumDataSyncs
    Error: EnumDataSyncs failed on initialization. Please check all registry information is valid and that HSS is running.
    Recommended Action: Make sure external checker is working.
    9 seconds
    FAILED EnumDimensions Launch external checker with next command: C:\Oracle\Middleware\EPMSystem11R1\..\jdk160_35/bin/java -DEPM_ORACLE_HOME=C:\Oracle\Middleware\EPMSystem11R1 -DEPM_ORACLE_INSTANCE=C:\Oracle\Middleware\user_projects\epmsystem1 -Djava.util.logging.config.class=oracle.core.ojdl.logging.LoggingConfiguration -Doracle.core.ojdl.logging.config.file=C:\Oracle\Middleware\user_projects\epmsystem1\config\validation\11.1.2.0\validationTool-logging.xml com.oracle.epm.epma.config.validations.dimeditor.EnumDimensions
    Error: EnumDimensions failed on initialization. Please check all registry information is valid and that HSS is running.
    Recommended Action: Make sure external checker is working.
    9 seconds
    FAILED PMAJ: EPMA Service Validating whether jobmanager service is available.
    Error: EPMVLD-01006: The EPMA service is not available. Check the log files for details.
    Recommended Action: Check that the server is running.
    0 seconds
    FAILED DSC: EPMA DimensionServer Server Configuration Validating EPMA Dimension Server hyperion-bpma-server startup... Failed...
    Error: Dimension server was not found in Shared Services Registry.
    Recommended Action: Check application is started.
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component EPMA_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    Foundation / Workspace
    PASSED CFG: Configuration Validating that configuration tasks have been completed
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component WORKSPACE was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    PASSED REG: Registry All links are present in the registry.
    0 seconds
    Planning
    WARNING CFG: Configuration Validating that configuration tasks have been completed
    EPMVLD-01004: The following configuration tasks have not been completed:
    Configure Database: Pending
    Register with Shared Services: Pending
    Configure: Pending
    0 seconds
    FAILED REG: Configuration Checking if product has only one product node in registry.
    Error: Component PLANNING_PRODUCT was not found in the registry.
    Recommended Action: Try to re-config product.
    0 seconds
    Test start time: 01/08/2014 07:07 AM
    Test end time: 01/08/2014 07:08 AM
    Total test duration: 87 seconds
    Please advise
    Thanks

    John  it happen again
    so i look at the Oracle Database Instance and it is up ?????
    Database Instance: ORCL  
    Page RefreshedJan 9, 2014 3:18:20 PM ESTView DataManuallyAutomatically (15 sec)Automatically (60 sec)
    General
    Status  Up
    Up Since  Jan 9, 2014 1:18:26 PM EST
    Instance Name  orcl
    Version  11.2.0.1.0
    Host  localhost
    Listener  LISTENER_localhost
    Please advise

  • Error when accessing Java and JVM section

    I'm getting the following error when accessing the Java and
    JVM section of the CF Administrator:
    "Element JDKPATH is undefined in FORM"
    I've searched a lot and there's very little on the topic. On
    this forum there are two posts and one got no answer, on the other
    it was suggested it might be the jvm.config file. I've looked at
    mine but I really have no idea what could be wrong. Also, there are
    two jvm.config files in my install, one in jrun4/bin and another in
    jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/runtime/bin
    folder (I did multiserver installation).
    I've already tried a bunch of things and no luck, any help is
    appreciated on this.

    quote:
    Originally posted by:
    ke4pym
    What is your path? Make sure you're using forward slashes.
    ie: d:/java/jdk1.6.0_12/bin/blah/blah/blah
    What path are your referring to? My actual PATH environment
    variable? Or are you referring to something else. Btw, here's what
    my config file looks like right now.
    # VM configuration
    # Where to find JVM, if {java.home}/jre exists then that JVM
    is used
    # if not then it must be the path to the JRE itself
    java.home=C:/JRun4/jre
    # If no java.home is specified a VM is located by looking in
    these places in this
    # order:
    # 1) bin directory for java.dll (windows) or
    lib/<ARCH>/libjava.so (unix)
    # 2) ../jre
    # 3) registry (windows only)
    # 4) JAVA_HOME env var plus jre (ie $JAVA_HOME/jre)
    # Arguments to VM
    java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false
    -XX:MaxPermSize=192m -XX:+UseParallelGC
    -Dcoldfusion.rootDir={application.home}/
    # commas will be converted to platform specific separator and
    the result will be passed
    # as -Djava.ext.dirs= to the VM
    java.ext.dirs={jre.home}/lib/ext
    # where to find shared libraries
    java.library.path={application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusi on/lib,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/jintegra /bin,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/jintegra/b in/international
    system.path.first=false
    # set the current working directory - useful for Windows to
    control
    # the default search path used when loading DLLs since it
    comes
    # before system directory, windows directory and PATH
    java.user.dir={application.home}/../lib
    # JVM classpath
    java.class.path={application.home}/servers/lib,{application.home}/lib

  • System registry

    Hi fellas,
    I was wondering if we can access system registry from java. If this can be done, plz lemme know how.
    Thanks,
    Kris.

    Isn't this package licensed under the GLP (not LGPL)?
    So, if you're developing commercial software doesn't
    that mean you might have problems?
    The GPL doesn't prevent commercial use.It prevents you making improvements and then keeping them for yourself (Something most corporations like to do). So long as you aren't distributing the binary you don't have to distribute the source, so if it's a program for internal use only there won't be any trouble.
    Which is assuming you're working for someone under their licence - if you're free I'd recommend going totally GPL anyway :)

  • BI Java and BI ABAP -RSPLAN issue

    Hi All
    We are working with BI system ,using BI 7.0 Java and BI ABAP as separate systems on same host.
    Already run the template intaller for BI Java and ABAP integration.
    But facing some issue ,when going ot BI ABAP and RSPLAN and clicking the Start Mideller
    it is opening a browser as http://host:8000/sap/public/myssocntl?sap-client-XXX
    Since this is not correct and it should open BI Java portal instead of ABAP stack page.
    Instead this should open a Url like this http://host:5XX00/webdynpro/dispatcher/sap.com/biplanworkbench1/Modeler?
    I check on BI ABAP system under SAP Reference IMG -> SAP Customizing Implementation Guide-> SAP NetWeaver _> Business Intelligence-> BI Integrated Planning -> Settings for Starting the Planning Modeler.
    There the default Url is BEx Portal Server and the url is        
    http://host:5XX00/webdynpro/dispatcher/sap.com/biplanworkbench1/Modeler
    Can anybody let me know why this is going to ABAP server instead it should go to Java.
    Regards
    Ajay
    Edited by: Ajay Sandal on Mar 10, 2009 2:31 PM

    Hi Ajay ..
    Good news that ur issue is resolved ..
    I have somewhat similar issue .. Hopu u can put some light ..
    I have Bi 7.o with Add on java  ,
    In RSPLAN from ABAP system , modular page is not coming . if i click on start moduler button in RSPLAN ..portal page is coming up and i have to give logging details .
    Please suggest .
    Thanks

  • How to get return value from java and read by other application?

    i want to read return value from java and the other application read it.
    for example:
    public class test_return {
        test_return(){
        public int check(){
            return 1;
        public static void main(String args[]){
           new test_return().check();
    }from that class i make as jar file. How to read the return value (1) by other application?
    thx..

    If your installer is requiring some process it invokes to return a particular value on failure, then the installer is seriously broken. There are a bazillion commands your installer could invoke, and any of them could fail, which in turn could invalidate the entire install process, and any of them could return any value on failure. The only value that's consistent (in my experience) is that zero means success and non-zero means failure, with specific non-zero values being different in different programs.
    About the only control you have over the JVM's exit code is that if your main method completes without throwing an exception, the JVM will have an exit code of 0, and if main throws an exception (either explicitly or by not catching one thrown from below), it will be non-zero. I'm not even sure if that's guaranteed, but I would guess that's the case.
    EDIT: I'm kind of full of crap here. If you're writing the Java code, you can call System.exit(whatever). But nonetheless, if your installer requires certain exit codes from any app--java or otherwise--you have a problem.
    Edited by: jverd on Oct 29, 2009 1:27 AM

  • Problem with java and javaw

    Hi,
    In running the following simple code, I have gotten different results using java and javaw.
    public class Test {
    public Test() {
    public static void main(String[] args) {
    int x =4;
    System.out.println("The value is "+ ((x > 5)?6.0:4));
    System.out.println("The value is "+ ((false)?6.0:4));
    System.out.println("The value is "+ ((true)?99:9.9));
    Using java, I get the following results:
    The value is 4.0
    The value is 4.0
    The value is 99.0
    But using javaw, I get the following results:
    The value is 4.0
    The value is 4
    The value is 99
    Any ideas why this is so?
    Thanks for any help.
    Gilbert

    I used JBuilder to run the following code and Jbuilder uses javaw.
    By the way, the correct answer is the one using java right?

  • Problem with Java and Zip Files

    Hello there everyone. I have a problem with trying to zip up directories with empty folders in them. They zip fine with my code, but according to winzip, the number of files in the archive is incorrect. It's supposed to have a total of 288 files in it, but when it's zipped up, it only says 284. I mention specifically the "empty directories" note because the zipping works fine without empty folders.
    Below is the code for the zip method:
    public static void zip(File[] list, File zipfile, File zipRoot)
         throws IOException {
          if (!zipfile.exists()) {
                   zipfile.createNewFile();
              else if (!zipfile.isFile()) {
                   throw new IOException("The zip file, " + zipfile.getAbsolutePath()
                             + " is not a file.");
              if (list.length == 0) {
                  LOG.error("The list of files to zip up is empty.");
              for (int i = 0; i < list.length; i++) {
                   if (!list.exists()) {
                        throw new IOException("The file or directory, " + list[i].getAbsolutePath()
                                  + " does not exist.");
              FileOutputStream fos = new FileOutputStream(zipfile);
              ZipOutputStream zos = new ZipOutputStream(fos);
              for (int i = 0; i < list.length; i++) {
                   if (LOG.isDebugEnabled())
                        LOG.debug(i + ": " + list[i].getName());
                   String entryName = getRelativeName(list[i], zipRoot);
                   if (list[i].isDirectory()){
                        if (list[i].listFiles().length == 0){
                             ZipEntry entry = new ZipEntry(entryName + "/");
                             zos.putNextEntry(entry);
                   else {
                        ZipEntry ze = new ZipEntry(entryName);
                        zos.putNextEntry(ze);
                        byte[] buffer = new byte[8096];
                        FileInputStream fis = new FileInputStream(list[i]);
                        int read = 0;
                        read = fis.read(buffer);
                        if (LOG.isDebugEnabled())
                        LOG.debug("\tFound " + read + " bytes.");
                        if (read == -1){
                             //empty file, but add it for preservation.
                             //zos.write(buffer,0,0);
                        while (read != -1) {
                             zos.write(buffer, 0, read);
                             read = fis.read(buffer);
                        fis.close();
                        zos.closeEntry();
              zos.close();
    The files look like they're there, but I need the system to be able to determine the number correctly. 
    Here's the interesting thing:  It zips the files, and then when I use the size() method for zip files in java, it says 284 files.  But when I unzip, it says 288 again.  It's like there's files missing when compressed, but when decompressed, they return.  Note that the files are actually there.  If I open the archive in a third party app such as Winzip AND Winrar AND IZarc, they all show 288 files.  Any idea what would make the number of files appear incorrectly in a zip file when zipped by java with the code above?  Thanks in advance.
    - Chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I figured out the problem. When zipping files in windows using winzip, it doesn't explicitly count folders as a "file/folder" as a file in itself. It will create the folders for files to go in, but the folder itself will not be 'counted' when you query the info of the file itself. You have more control of the zip file in java, and can count the folder as a file or not.

  • I'm new to Java and can't get javac command working

    Ok first of all hello ( i'm new to the forum ), second i'm reading a book about Java and im trying to compile a sample code from the book, but javac command gained life and it's against me. So the book i'm reading is Sams Teach Yourself Java in 21 Days (YAY), and the code i want to compile is an application that works with another bit of code that mimics what a robot could do inside a volcano. So the Volcano program code is the following ( i'll post the robot code at the end of the post):
    1: class VolcanoApp {
    2: public static void main(String[] arguments) {
    3: VolcanoRobot dante = new VolcanoRobot();
    4: dante.status = ?exploring?;
    5: dante.speed = 2;
    6: dante.temperature = 510;
    7:
    8: dante.showAttributes();
    9: System.out.println(?Increasing speed to 3.?);
    10: dante.speed = 3;
    11: dante.showAttributes();
    12: System.out.println(?Changing temperature to 670.?);
    13: dante.temperature = 670;
    14: dante.showAttributes();
    15: System.out.println(?Checking the temperature.?);
    16: dante.checkTemperature();
    17: dante.showAttributes();
    18: }
    19: }
    Ignore the numbers they are used for explaining stuff in the book, and i din't copy the indentation.
    So what i do is that i creat a file with notepad ( no fancy stuff only plain old notepad ) and i copy this code, remove the numbers and make the indents.
    After that i save as .txt file with the apropriate name ( i know it's case sensitive ). After that i open command prompt and write:
    javac VolcanoApp.java
    And it tells me that "javac is not recognized as an internal or external command operable program or batch file".
    I managed to solve that by going to the control panel and by adding to the system variables for my user in the path variable this :
    ;C:\JAVAJDK\bin
    ( C:\JAVAJDK is where JDK is installed)
    And then i modified the system variables like this:
    In the CLASSPATH i entered this .;%JAVA_HOME%\lib\tools.jar
    In JAVA_HOME i entered this C:\JAVAJDK
    Setting the variables like this made the javac error go away but now when i write in command line
    javac VolcanoApp.java
    It gives me this error
    javac: file not found : VolcanoApp.java
    Usage: javac options source files
    use -help for a list of possible options
    And then i read that i can drop my java file directly in the javac file. So i did.
    When i drop my VolcanoApp.java in the javac file it open a command line window and writes a bunch of stuff in like a milisecond and shuts down. And no file is created.
    I wanted to know what was writen in that window so i did it again and took a print screen and pasted it on paint ( it writed so much text that i only got a little bit but enough to see what hapend)
    I read it and in the print screen it said it had 15 errors ( so far ) and then it point the errors with little arrows and there were characters that weren't present in the original code.
    What hapend the compiler added wierd letters?
    SO, my real question is, how the heck do i get javac working and compiling stuff properly?
    Plz help i'm getting mad at this! ; (
    And the code for the "robot":
    1: class VolcanoRobot {
    2: String status;
    3: int speed;
    4: float temperature;
    5:
    6: void checkTemperature() {
    7: if (temperature > 660) {
    8: status = ?returning home?;
    9: speed = 5;
    10: }
    11: }
    12:
    13: void showAttributes() {
    14: System.out.println(?Status: ? + status);
    15: System.out.println(?Speed: ? + speed);
    16: System.out.println(?Temperature: ? + temperature);
    17: }
    18: }
    Again no indents and ignore the numbers. In the book it only said to compile the VolcanoApp.java , and not the VolcanoRobot.java
    Edit:
    I'm using Windows Vista Home Premium 32 bit.
    Edited by: BBlop on Dec 13, 2009 11:29 AM

    guess what it says java file. So yes i'm sure. Sarcasm. Not the best way to encourage a total stranger to help you. Then there's
    Sorry if i wasn't more clear but was that response needed?No it wasn't needed, but I'm not the one asking for help so I have the luxury of not worrying too much about it. It's extremely frustrating trying to drag relevant information out of someone, and makes one less inclined to bother.
    Anyways, there's still nothing in this thread that actually explicitly says "there is a file called VolcanoApp.java in the directory where I'm running javac from" and I really can't be bothered banging my head against the wall any longer. You've made a silly mistake, or a false assumption. We all do it from time to time. My advice is, take a break, go for a walk and re-visit this in a while. You'll probably spot the mistake right away.

Maybe you are looking for

  • My Macbook Pro Retina doesn't turn on but charger led works

    I haven't used my mac for a month but it use to work perfectly fine. I tried to use it but it wouldn't turn on. When i plug the magsafe connecter the led goes orange. But when i press the power button it doesn't turn on. i tried smc reset using left

  • Import file from pages to iphoto

    Im trying to import a file from pages to iphoto...having a hard time

  • Call of duty ghosts trade in offer

    Is it still valid today? I heard about it and for some reason I can't click on the offer when looking at advanced warfare on my phone. Thanks guys Solved! Go to Solution.

  • Include a library in plsql -- Urgent

    In have a library en plsql and I need to include it in my jsp, and to use some functions o procedures of it. How I can to do it.???????????????

  • JDeveloper10g with Oracle Database 7

    I would like to know that if i can use JDeveloper10g to connect to an Oracle Database 7 to retrieve data and show these data in a PDF file? and if it is not, what is the tool that I can use it for my problem? Please,