Getting 64 Bit JVM To Work?
Jun 18, 2014
The problem is as follows: I've been running java script using git bash and at one point it tells me that I need to increase heap size because apparently it takes more than 1gb to run. However although I manually increase it via control panel>programs>java nothing changes. I've been told that I need to ' figure out how to use 64bit java (and a VM that supports 64bit) in order to increase the maximum memory allocation (heap size) to something north of 2g.'
My laptop has 8GB worth of RAM (Windows 7)so it shouldn't technically have problems running anything above 1G. But there is apparently a 1GB wall But increasing the heap size to above 2G results in an error stating that VM doesn't initialize within git bash, I thought that my java is 32 bit so I downloaded a 64 bit java. Now how and if it is even possible to allocate a program to run under 64 bit java and if I should delete the other java version.
View Replies
ADVERTISEMENT
Dec 13, 2014
how does recursion works, I don't understand why it prints al numbers going up again?This is the code
void print2(int n){
if (n<0){
out.printf(" %d",-1);
return;
}
out.printf(" %d", n);
print2(n-1)
out.printf(" %d", n);
}
this should be the output if n is 6: 6 5 4 3 2 1 0 -1 0 1 2 3 4 5 6.
View Replies
View Related
Mar 6, 2015
I need to create a chart for work and comes across this sample from mbostock's chord diagram (bl.ocks.org/mbostock/4062006).
I only need to revise the tick label (names, display positions) but I don't know how to do it as I have 0 experience with Java.
My sample data for the var matrix is
[0,100,100,100]
[0,0,99,98]
[0,0,92,84]
[0,99,0,0]
which shows flows between country A, B, C and D.
I would like to revise the tick labels, so that:
1) Instead of showing 0K 5K 10K, I would like to show the country names (A - D), with no number or tick. I figured out this one by just commenting out all the codes relating to ticks.
2) Place the country names in the center of the arch. I don't know how to do this one.
View Replies
View Related
Mar 5, 2014
a buffer reader , how does it work and what is the code for it ?
View Replies
View Related
Oct 9, 2014
I've got a panel which an arbitrary number of text fields may be added to at run time. I've got it set up so that the window's height, and the height of the panel in which the fields appear will never exceed the height of the screen.What I don't have is a way to make the panel scroll to access the fields that are being visually truncated. I'm setting the autoscrolls on the panel to true, but when I run the program, the fields are simply truncated.
pnlDeclensions.setAutoscrolls(true);
View Replies
View Related
Jun 10, 2014
how inheritence and exception work together ?? what are the rules ??
View Replies
View Related
Oct 4, 2014
So I'm working on a project and noticed that my toString() method won't work. This is just an example of the type of code that I have in my real project. THIS IS MY MAIN CLASS
XML Code:
package trialanderror;
import java.util.Scanner;
public class TrialAndError {
public static void main(String[] args) {
Scanner keys = new Scanner(System.in);
String name;
String phonenumber;
[code]....
View Replies
View Related
Nov 17, 2014
I want to create a dropdown menu with contents from a database. You can see my Code in the attachment. It does not work, but why? I have a dropdown-symbol, but no contents.
View Replies
View Related
Apr 8, 2014
I use Chrome rather than IE. Recently I got an error message when I tried to deposit a check online.
It said that I needed up get a newer version of Java than 6.10, so I downloaded 7u51.
When I tried to deposit the check again, Chrome asked if I wanted to run the app, and I said yes, but that took me back to the download link again.
I spent almost an hour with my bank experts, but they were unable to solve the problem.
When we tried it on Internet Explorer, it worked fine.
Later, I discovered that on the Java Control Panel under the Default Browser for Java, it has only IE and Mozilla, with the IE being checked and greyed out.
I'm assuming that's why the problems on Chrome, even though up until a few days ago, I was able to deposit checks using Chrome-Java.
View Replies
View Related
Jan 12, 2015
All I am trying to do is to make a section of code execute if two strings are equal. The two strings are userId and "A001062". When I use the debugger in Eclipse, I can see the value of userId as "A001062" but whatever string comparison I try never evaluates to true. I have tried
userId=="A001602"
userId.equals("A001602")
"A001602.equals(userId)
Assigning A001062 to a string called AAA and comparing userId to AAA
My code is as follows. I have also attached a screen shot from the Eclipse Debugger which makes me think the string comparison should succeed. I never see the debugger execute the print line nor do I see the print line on the JBOSS console.
String userId = StringUtils.trim(nextLine[HR_USER_ID]);
String AAA="A001062";
if (userId.intern().equals(AAA.intern())) {System.out.print("MKP1: " + userId+"-"+managerId);}
if (userId.compareTo("DTS0428")==0) {System.out.print("MKP2: " + userId+"-"+managerId);}
Attached image(s)
View Replies
View Related
Sep 13, 2014
import java.util.*;
public class OneDimenArray {
public static void main(String[] args) {
double[] decimals = new double[12];
double nums = 0.0;
double a = 1.0;
[Code] ....
These are the erroe codes I'm getting;
OneDimenArray.java:13: error: ']' expected
double[] decimals = double[Scanner.nextDouble()];
^
OneDimenArray.java:13: error: ';' expected
double[] decimals = double[Scanner.nextDouble()];
^
2 errors
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
View Replies
View Related
Dec 14, 2014
Okay so I have this part done and I cannot get all the JButtons to work. This is my first GUI!
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.PrintStream;
import java.util.Arrays;
import javax.swing.BoxLayout;
[Code] ....
BTW the error is on 310, 311, and 312 and the error is cannot find symbol ....
View Replies
View Related
Mar 20, 2015
I am trying to get the gridBagLayout function to sort my code to look like the attached image. I am having trouble figuring out how to do it or even where to start. My code can be seen below and this was as far as I could get on my own.
// Using JSlider to size an oval.
import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JSlider;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeListener;
[Code] .....
View Replies
View Related
Nov 4, 2014
I have being trying to figure out why my string doesn't work as a passcode and I can't seem to figure out why.
import java.util.*;
public class Login
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("Hello there, please state your name");
String userName = in.nextLine();
[Code] ....
View Replies
View Related
Mar 5, 2014
I have a code issue and I have a below question for the same.Assuming data[] is of type byte[], is the below statement in java -
while((data[p++] & 0x80) == 0x80);
same as -
while ( (data[p] & 0x80) == 0x80 ) { p++; }
I tried with do { p++; } while ( (data[p] & 0x80) == 0x80 ); That also doesn't seem to be the same thing. I am not putting code around this but essentially if I make this change for not using data[p++] code stops working!
View Replies
View Related
Feb 26, 2014
I have a simple applet that doesn't stray outside the sandbox. It used to work fine before Java 7 but now it craps out with security warnings. It does nothing but play a game, it doesn't even save the state of the game. This is the applet, it's a very simple chess program.
The warnings and popups I'm getting are:
activate javaTM platform SE 7U?allow now?activation blocked by security settings - I never changed any security settings and as I said, this applet stays firmly in the sandbox so I can't see what the issue is.Viewing the java error window I see
Java Plug-in 10.51.2.13
Using JRE version 1.7.0_51-b13 Java HotSpot(TM) Client VM
User home directory = C:UsersMike
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
[code]....
why it shows the C:UsersMike directory in the above listing, there is no access to files etc.The applet plays fine if I run it in appletviewer.What do I need to do to make this simply work in anyone's browser? I have a similar problem with a (rather funky) Connect 4 program I wrote. It worked fine for years and then just stopped with the Java 7.
View Replies
View Related
Apr 25, 2014
I can't get Relative paths to work. I have created the class.dat file and I can't get java to recognize it. I am using Eclipse as an IDE. Was wondering if I could get Eclipse to recognize it. I tried with a .txt file as well and couldn't get that to work.
import java.io.*;
public class ReadBytes
{
public static void main(String[] args)
{
try
{
FileInputStream file = new FileInputStream("class.dat");
[Code] .....
View Replies
View Related
Apr 22, 2014
Why this will not pad?? It keeps displaying normally, even if i add spaces it will not work.
System.out.printf("%-20s%-20s%-20s%-20s", p.getLastName(),
p.getLastName(), p.getSocialSecurityNumber(),p.getAge());
This is what it is printing:
=================== =================== ====================== ===
lastname, firstname, 123-12-1234, 16
The lastname, firstname, 123-12-1234, 16 should be padded and appear with about 20 spaces between them.
View Replies
View Related
Nov 24, 2014
I am doing the sorting of multiple fields. This sorting requires to sort the emergency numbers first followed by queue time. However, the sorting is fail, which is the emergency numbers are sorted correctly only but not the queue time. I try to figure out the problem but unfortunately I cannot find where the problem is. Below are the codes for my assignment (Please take note that there is no need to check both ListInterface and LList class) :
public interface ListInterface<T> {
public boolean add(T newEntry);
public boolean add(int newPosition, T newEntry);
public T remove(int givenPosition);
public void clear();
[code]....
This is the attachment of the result that I ran earlier:
Capture.jpg
The first list is before sorting while the second list is after sorting.
View Replies
View Related
Jan 28, 2014
It's suppose to generate a table with the month, and the new amount of the CD. Right now, the program generates a continuous table for months, but it doesn't update the value of the CD.
import java.util.*;
public class Excercise04_31 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
[Code] ....
View Replies
View Related
Jul 3, 2014
I am trying to get user inputs (double types). so when i get a letter instead of a double i get an exception even though i had a while loop checking for this. so i looked up how to do exception handling and now when i get to that point it catches it but only outputs the message i gave and terminates instead of going through the while loop again. apparently there is no way to go back to before the error happened unless you use a while loop. but the loop isn't working it just terminates.
here's the code:
public static void collectInfo()
{
double firstW=0;
double secondW=0;
[Code].....
and here's the output when i ran the program(console):
Enter hours received for the first week of your paycheck. If you have overtime, just add it to this for example: 3 hours of overtime is 43 hours that week
View Replies
View Related
Feb 11, 2014
Why I can't get an external style sheet work work when using JSP files? Putting a link in the doc head like I would for an HTML or PHP file does not work. The style sheet is in the exact same directory as the JSP files and I cannot get it to work. I think I have tried about everything that has been suggested on the web with no luck.
If I create an HTML doc in the same directory as the JSP files, and add the below line in the document head, it works fine. Doing the same thing with a JSP file does nothing.
<link rel="stylesheet" type="text/css" href="style.css">
View Replies
View Related
Jan 8, 2015
Lets suppose that I pass to the sort method a list of 2 objects of the same class (which implements Comparable interface). I read (in head first java) that one object is compared relative to another with one object calling the CompareTo() while the other object being passed as a parameter to the same method. Now am I safe in assuming that the first object in the list calls the method with the second object being passed as a parameter.And also how does the CompareTo() work if there are more than 2 elements in the list. Which objcet calls the method and which is passed as a parameter?
View Replies
View Related
Dec 12, 2014
I made this calculator in C++ and it worked wonderful so I decided to make it in java. When I run the program it gives me no errors but my if statements inside my while loop don't work
import java.util.Scanner;
public class ohmlaw {
public static void main(String args[]) {
float current;
float resistance;
float voltage;
String calchoice = new String();
Scanner cc = new Scanner(System.in);
[code]....
View Replies
View Related
Apr 10, 2014
/code
package com.eclipsedistilled.cis125;
import java.util.Scanner;
public class HowellBank {
public static void main(String[] args) {
//Written by George Torgerson
//Chapter 4 Link to Logic 7
//Program that accepts an account number, the account owner's first
//Declarations
int accountNumber;
[code]....
This is for college homework. Fictional bank. I would like the year to look like Year 1, Year 2, etc.
View Replies
View Related
Nov 19, 2014
I am writing small pieces of code to make sure I understand Java basics and I have the following.
package teams1;
public abstract class Team1{
private String sport = new String();
public abstract String getSport();
public abstract void setSport();
}
import teams1.*;
[Code] .....
It doesn't compile because sport is private in the super class, but I thought FootballTeam1 would inherit it's own copy of sport because it is extending Team1.
View Replies
View Related