Java

99K

Solutions

33K

Contributors

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi, I am new to postgreSQL.  I have a question about how to connect to postgreSQL db in java ?
0
Microsoft Azure 2017
LVL 13
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

HI, I have a question related with maven:
I had checked out some new code in Eclipse, then I clicked "Run As"-> "Maven Clean". I got an error like below:
[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: 'mirror' (position: START_TAG seen ...</mirrors>\n  \n  <mirror>... @161:11)  @ C:\Users\fdsx134\.m2\settings.xml, line 161, column 11
[WARNING]
[INFO] Scanning for projects...
[INFO] Downloading from : http://artifactory.xyz.com/artifactory/libs-release/org/springframework/boot/spring-boot-starter-parent/1.5.9.RELEASE/spring-boot-starter-parent-1.5.9.RELEASE.pom
[INFO] Downloading from : http://artifactory.xyz.com/artifactory/spring-milestones/org/springframework/boot/spring-boot-starter-parent/1.5.9.RELEASE/spring-boot-starter-parent-1.5.9.RELEASE.pom
Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.xyz:plan-Inventory:0.1.9: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.RELEASE from/to central (http://artifactory.xyz.com/artifactory/libs-release): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at wrong local POM @ line 11, column 10
 @
The build could not read 1 project -> [Help 1]
 
 …
0
It being quite quiet presently on the TA, I thought it might be amusing to criticise/improve/trash/comment on or otherwise engage with, this chunk of knockabout code for a little fundamental diversion.

 

import java.io.*;
import java.awt.*;
import java.net.*;
import java.util.*;
import javax.swing.*;
import java.awt.font.*;
import java.awt.event.*;
import java.awt.image.*;

    
	public class LotteryPicker extends JFrame {
		
	private JPanel jpanel_1;
	private ThisCanvas canvas;
	private JButton pickUK;
	private JButton pickEuro;
	private JButton pickthunderball;
        private JButton pickFor30;
	private PickPlainListener ppl;
	private String oldUKS = "";
	private String oldEUPair = "";
	private String oldEUS = "";
	private String oldTHU = "";
	private String oldTHUSingle = "";
        private String old30 = "";
        private String old30Single = "";
	private String buttonNumberClicked;
	private String chosenCopy;
	private boolean minimizedOnEmpty = false;
	private Color ballNumberColor;
	private final int PULSE = 6;
	private final int STARTINGOFFSET =  8;
	private final Color CANVASBACKGROUND =  new Color(240,240,240);
	private final Color BALLBACKGROUND =  new Color(140,130,110);
	
	
						public static void main(String[] args){

							new LotteryPicker();
								
						}
					
						private LotteryPicker(){
					
								makeGUI();
						
						}
						
						private void makeGUI(){
												
							GridLayout gl_jp_1 = new GridLayout(4,4);
							

Open in new window

0
hi how do i add oracle sql data source when creating spring boot application my database in oracle database 12c
spring
0
Hello Experts,
Through SourceTree, I have created a new GIT branch (let us call it temporary branch) from a Feature Branch. When I push something to the Feature Branch, I expect the temporary branch to track the Feature Branch and notify me that there are commits to be pulled. For some reason, I do not want to merge the temporary branch to the Feature Branch for some time, but like to have all the latest changes in the Feature branch pulled on-to temporary. Can  you please let me know if this is possible?
0
hi,

How can I run a .jar file at computer startup, and have the application running all the time, until computer shutdown?

thanks
Carolin
0
hi am having this error in angular
angular
0
hi am having this error in android
android
0
hi am geting the following error

11 Sep 2019

18:37 All files are up-to-date



18:37 Error running 'All in tdm-pet-clinic': No junit.jar
this is my pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <groupId>guru.springframework</groupId>
    <artifactId>tdm-pet-clinic</artifactId>
    <version>0.0.5</version>
 
    <modules>
        <module>pet-clinic-data</module>
        <module>pet-clinic-web</module>
    </modules>
 
    <packaging>pom</packaging>
 
    <name>tdm-pet-clinic</name>
    <description>SFG Pet Clinic Project</description>
 
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
 
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <jaxb.version>2.3.0</jaxb.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
    </properties>
 
    <dependencies>
        

Open in new window

0
hi am geting the following error

Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version name:   Apache Tomcat/9.0.20
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          May 3 2019 22:26:00 UTC
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version number: 9.0.20.0
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 10
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.0
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Java\jdk1.8.0_111\jre
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.8.0_111-b14
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         C:\Users\Desmond\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Sep 09, 2019 8:31:28 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         C:\Program Files\Apache Software …
0
Become a CompTIA Certified Healthcare IT Tech
LVL 13
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Hi there,

My Spring Boot project is now very slow to start / restart.

A friend suggested me to use GraalVM and that really saved a few seconds without even touching the codebase.

Do you have any similar suggestion that I can use to improve my development process speed?

Refactoring or other big topics are indeed good ideas but not specifically what I am looking for at the moment.

Thanks for your time and help.
0
Hey,
so on E.E. , I have been able to finish an RTS server in Java, blog w income, I'm ready to commit to a JS phone game..
I'm using ATOM as my Interactive development environment. Will it be suboptimal for my various publication needs?
If I do my game on a web page, it is simply placing the .htm file and the .js file in the folder. What about app compilation? Do the google and Mac stores have their way to package the javascript somehow? What should I be aware of?

I just make the game and worry later? :)

Thanks
0
QSH JAR command get errors with VARCHAR fields in PF :
java.io.IOException:

at java.io.FileInputStream.read(FileInputStream.java:250)            
        at sun.tools.jar.Main.copy(Main.java:891)                            
        at sun.tools.jar.Main.copy(Main.java:906)                            
        at sun.tools.jar.Main.addFile(Main.java:853)                        
        at sun.tools.jar.Main.create(Main.java:557)                          
        at sun.tools.jar.Main.run(Main.java:226)                            
        at sun.tools.jar.Main.main(Main.java:1300)      

call CMD:
QSH        CMD('JAR cvfM /TestJAR/xxxxxxxx.ZIP -C +      
              /QSYS.LIB/Testlib.LIB/xxxxxxxxx.FILE +    
              xxxxxxxx.MBR')                          

How to get the Output ZIP-file from PF  with VARCHAR fields ?

PF is  SQL table

"Problem fields" for JAR are defined like this :

 FLD1            CHAR            1       3       184        Both      
    Variable length field -- Allocated length :  None
    Default value . . . . . . . . . . . . . . :  None
     Coded Character Set Identifier  . . . . . :  65535

   FLD2        CHAR           80      82       187        Both    
     Variable length field -- Allocated length :  None
     Allows the null value
    Coded Character Set Identifier  . . . . . :    273
0
Record
I am using the "each statement" with the handlebars template engine in node.js.  Unfortunately, each record is being tabbed to the right of the previous one, as the attach image shows. I would like each record to line up evenly.
Please see the code:

Here is the file:gigs.handlebars

{{#each gigs}}
<section id="gigs" class="container">
<!--<h1>All Gigs</h1>-->
<h1>{{equipment_area}}</h1>
<div class="gig">
      <h3>{{title}}</h3>
      <!--<p>{{manufacturer}}</p>-->
      <ul>
        <!--<li>Budget: {{budget}}</li>-->
        <!--<li><a href="mailto:{{contact_email}}" class="btn btn-reverse">Apply Now</a></li>-->
        <li>Equipment Type: {{equipment_type}}</li>
        <li>Manufacturer: {{manufacturer}}</li>
        <li>Model Number: {{model_number}}</li>
        <li>Serial Number: {{serial_number}}</li>
        <li>Condition: {{severity}}</li>
        <li>Comments: {{general_comments}}</li>
                
      </ul>
      <!--
      <div class="tech">
        <small>Technologies Needed: <span>{{technologies}}</span></small>
      </div>
      -->
    </div>
    {{else}}
     <p>No gigs available</p>
    {{/each}}
</section>

Open in new window


Please also see the css file:
@import url('https://fonts.googleapis.com/css?family=Lato');

:root {
  --primary-color: #568c9b;
  --primary-hover-color: #64a5b7;
  --bg-color: #333;
  --box-shadow: 3px 4px 12px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Lato',

Open in new window

0
i have a code below where i am traversing a list in jsp containing employee_id and employee_name
<tr>
                                                <td align="top"><INPUT class="inputtext" name="chkBox" type="checkbox" value="<%=employee.get(0)%>" size="50"></td>
                                                <td><label><%=employee.get(0)%></label></td>
                                                <td><label><%=employee.get(1)%></label></td>
</tr>

along with each and every row there is a checkbox when i am selcting chekboxes and click on submit button presently on employee_id (value="<%=employee.get(0)%>") is going along with
checkbox value i want both employee_id and employee_name will go with checkbox value to servlet . in servlet there is a query run and employee_id and
employee_name should be entered into specific table. please help me out on this .please let me know if not clear.
0
HI Team ,

I am retrieving value from database through JDBC statement  my plsql query is below -

Select * from A union Select * from B.

but when i am retrieving value through JDBC statements its give null . when i am individually running query like Select * from A without using Union  its working fine and giving results but when i am using 2 query via Union its give Null. Please tell me where i m wrong .
0
Hello,
in Java Strings are immutable.
If so, why is this possible?

String s = "abc";
s="def";

Open in new window

0
I am rewrite an java app. The original is a jar file.  In the project it is calling http URL connections. Do I need to  generate a dynamic web project or just a simple java project?

Thanks
0
Hi everyone,
I'm encountering a weird issue from Windows slave in Jenkins, I tried many solutions provided in Stackoverflow, but no luck. So I re-post my question here to looking for your support.

I just setup a new jenkins slave which is running Windows server 2012. I already installed jdk-8u221-windows-x64 and set Java_home, Path like below

C:\Users\Administrator>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_221\

C:\Users\Administrator>echo %PATH%
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\
Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\
Program Files\Amazon\cfn-bootstrap\;C:\Program Files\Git\cmd;C:\Program Files\Ja
va\jdk1.8.0_221\\bin;C:\maven\bin;C:\maven\bin

Open in new window


However,build job running in this slave always complain that:

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

Open in new window


Here is a slave node configuration:
Slave node configuration
In a Job build configuration, I selected (System) in JDK option. If I choose JDK 8 update 221, this build job run successfully, but I want to use a (System) JDK which will get from environment variable in this node, so I can switch to another slave node without changing the JDK option.
Job build configurationHowever, when I remote to this server, and open command prompt, cd to workspace folder of this project, let say: C:\jenkins_slave\workspace\project01\, then type the command: mvn clean install, it run without complain about jdk or jre as run from Jenkins. That's very surprise.

Any idea of what might be causing this? If you need more info, please let me know.
Thanks.
0
Announcing the Winners!
LVL 13
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

Hi,
 
 The "NVWatchDogService" service on our Windows 2012 R2 server stopped working,
task manager status shows this service "Starting" even after reboot.

There are two Event Viewer errors when stopping and restarting this service:

  Event Error 1.
Description:
Service cannot be started. System.ApplicationException: Failed to start java Service.
   at ShunraBootstrapperService.JavaStarter.StartService()
   at ShunraBootstrapperService.BootstrapperService.OnStart(String[] args)
   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

   Event Error 2.
Description:
Error while creating file: Access to the path 'C:\Program Files\HPE\NV\OpenJRE\bin\NVServicesJ.exe' is denied.

Suggestions are greatly appreciated.

Thanks,
0
How can i refresh a div only once i got a response from popup.my scenario is below -

i have a Parent JSP page . in parent.jsp page there is a button which opens a popup when popup is open it fetch the table data from database . table data contains Employee_ID, Employee_Name . in popup jsp when displaying data each and every row contains a checkbox . after multiple selection of checkbox there is a submit button in popup.jsp , after submitting the page comes back to the parent.jsp page and display the popup.jsp submitted Emplyee_ID and Employee_Name.

my problem is when i m getting response back from popup.jsp to parent.jsp file my specific table is not refreshing , when i am debugging parent.jsp , list are coming with data but not displaying because it is not refresh at the moment when response are coming back from popup.jsp t parent.jsp .

Please let me know the solution.
0
Hi Team ,

i have a problem but i did't get any solution for it . i have a parent jsp from where a search icon is there when i click on search icon a popup jsp is open . in popup jsp i retrieve values form database and display.
there is 2 column in database Employee_ID and Employee_Name. all values come row by row and display on popup jsp . in each row there is a checkbox no my problem comes and i did't get any solution for it please help me out.there is two case -

1 Case - when i check multiple check boxes in popup.jsp and click on submit button(popup.jsp) the value of Employee_ID and Employee_Name   should display on parent.jsp.

2 Case - when i check multiple check boxes in popup.jsp and click on submit button(popup.jsp) the value of Employee_ID and Employee_Name should go to a servlet and after that servlet send that data to parent.jsp.


please let me know both of the above solutions.
0
HI

one of my applications suddenly hang...

it is runing thorugh java ... i tried to end the task using take manager

when i clicked the shortcut  for the applciations it asked what application to open only was there internet explorer

i clicked explorer  then all  exe files now not opened

i cant even run task manager

please have a look

is this virus or somo modifications neded
1
Hello Experts,

We do have enough  free space  to start the JAVA process but getting error like below:

Error: Could not create the Java Virtual Machine
Error : A fatal exception has occurred, Program will exit.

 The same program was running since 3 years with java version :
JAVA Version :
C:\Users\.......>java -Xms512m -Xmx1536m -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

Open in new window


HeapSize:

C:\Users\*********>java -XX:+PrintFlagsFinal -version | findstr /i "HeapSize
PermSize ThreadStackSize"
    uintx AdaptivePermSizeWeight                    = 20              {product}

     intx CompilerThreadStackSize                   = 0               {pd produc
t}
    uintx ErgoHeapSizeLimit                         = 0               {product}

    uintx HeapSizePerGCThread                       = 87241520        {product}

    uintx InitialHeapSize                          := 2147483648      {product}

    uintx LargePageHeapSizeThreshold                = 134217728       {product}

    uintx MaxHeapSize                              := 2061500416      {product}

    uintx MaxPermSize                               = 85983232        {pd produc
t}
    uintx PermSize                                  = 21757952        {pd produc
t}
     intx ThreadStackSize                           = 0               {pd produc
t}
     intx VMThreadStackSize                         = 0               {pd produc
t}
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

Open in new window


Can anyone help to what is wrong here ? If we remove the condition on the max and min size then the program runs fine and also on java version 1.8
0
Hi
I have been directed to a javascript example housed in the Tryit editor, where example javascript code was pasted in for me to run. I modified it. But, I like the editor.

Is this a sterile and indifferent editor? Need I be concerned about what I run in it? Lame question, but it was a minuscule concern that undesirables could be gifted my code in the future.

here

Thanks
0

Java

99K

Solutions

33K

Contributors

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.