Running Java Program In 32bit / 64bit Versions Of Linux
Jul 17, 2014
I wrote some java applications on my computer, which is 32-bit Ubuntu 12.04 LTS. Could the application run on both 32-bit and 64-bit versions of linux? Or could it only run on 32-bit versions of linux?
System.out.println(System.getProperty("sun.arch.da ta.model")); // outputs 32
I would like to know if I run it on a 64-bit version of linux if it will take advantage of the performance advantages of 64 bits.
View Replies
ADVERTISEMENT
Apr 24, 2014
import acm.util.* ;
import acm.program.*;
import java.awt.* ;
class Chap6_ex1 extends ConsoleProgram {
public void run() {
println("This program displays a randomly schosen card.");
int number = rgen.nextInt(1 ,13);
int suit = rgen.nextInt(1 ,4);
[Code] ....
I am running the this from a Linux command line , in the cmd first i use :
javac -classpath acm.jar Chap6_ex1.java
end then :
java -cp .:acm.jar Chap6_ex1
The output i m getting after second command is :
Exception in thread "main" acm.util.ErrorException: Cannot determine the main class.
at acm.program.Program.main(Program.java:1358)
I know the problem is from the RandomGenerator class in packet acm.util.* but i dont know how to fix the problem . Every other program has worked . What I am missing or how this whole issue of packet importing works when running a java file from cmd ?
View Replies
View Related
May 22, 2014
I'm running a jar of an application and library jars from lwjgl. I'm creating a java process. It's working on Windows but not on linux.
I tried replacing the semicolons with colons but it didn't work, it just said "Main class not found: Application.natives.linux" or something like that. gamePath is the path the application is in. osName is the name of the operating system.
Here's my code:
String jarRunner = String.format("java -Djava.library.path="%snatives/" + osName + "" -cp "%sjar/lwjgl.jar;%sjar/lwjgl_util.jar;%sjar/jinput.jar;%sjar/slick.jar;%sApplication.jar" main.Main", gamePath, gamePath, gamePath, gamePath, gamePath, gamePath);
Process p = Runtime.getRuntime().exec(jarRunner);
[Code] ....
How can I make it work on linux?
View Replies
View Related
Apr 6, 2014
I want to find information about running sudo commands from java, but without gksudo/kdesudo.
This is my code. It works, but after removal "sudo" element.
Java Code:
String array[]={"sudo", "dolphin"};
Process proc = null;
try {
proc = Runtime.getRuntime().exec(array);
}
catch (IOException e) {
e.printStackTrace();
} mh_sh_highlight_all('java');
How I can insert password in this terminal? I tried write pass after array with commands and in, and even in outputstream.
View Replies
View Related
Nov 25, 2014
I have 2 different apps, one of them is a java desktop app and the other one is a c# web app. which uses java applet in order to e-sign. The problem is desktop java app requires 1.5.0_14 and on the other hand web app. requires 1.7 and higher version of java.
I installed both java 1.5 and 1.7 versions on my PC. In order to run desktop java app., I go to C:Progra~2Javajre1.5.0_14in and run javacpl to disable 1.7 and enable 1.5. Then I make a shortcut to javaws 1.5.0_14 to my desktop and add the jnlp of this java app to the target of javaws shortcut. After those settings, the java desktop app. runs.
Now I need to also run the web app which requires 1.7 java. In order to run this app. properly Java 1.5 should be disabled, 1.7 enabled on the Java Control Panel settings. Problem is when you run this web app. the settings for 1.5.0_14 breaks down, I mean all of the java versions become enabled in javacpl under C:Progra~2Javajre1.5.0_14in directory. If I restart my PC, I need to reset the java versions. Is there a way to make this happen without a pain in the head?
By the way, I tried to use batch files etc. but not succeded.
View Replies
View Related
Apr 16, 2015
I have tried to get my dinky little program I wrote to be stored as an executable through Eclipse to no avail. It seems I have tried everything else as well, to no avail. I do not want it to go through command prompt, but rather have it be its own entity. As you can probably tell my knowledge of Java and coding is limited, but always willing to expand.
View Replies
View Related
Jan 25, 2014
I want to know is there any way to run java program without installing jdk.
I want to run my code on system which dnt have jdk installed on it. is it possible??
View Replies
View Related
Apr 5, 2014
I am trying to install Java on my Debain based Linux OS and can`t seen to figure it out. I first typed "chmod +x jdk-8-nb-8-linux-i586.sh", than typed "./ jdk-8-nb-8-linux-i586.sh" to install it. It started to install, but than it gave my this message: (computer name has been changed)
bobsmith@bobsmiht-OptiPlex-GX620:~/Downloads$ ./jdk-8-nb-8-linux-i586.sh
Configuring the installer...
Searching for JVM on the system...
Preparing bundled JVM ...
./jdk-8-nb-8-linux-i586.sh: 1: eval: /tmp/.nbi-5045119.tmp/jre-7u4-linux-i586.bin: not found
Cannot prepare bundled JVM to run the installer.
Most probably the bundled JVM is not compatible with the current platform.
How do I fix this? My Linux computer is not connected to the internet, I don`t know if this is a problem or not.
View Replies
View Related
Jul 29, 2014
Not a Java editor with a GUI, but and editor for editing Java GUI's (Graphically (With JFrame, Swing etc) (Kinda like FrontPage for HTML only for Java/Linux. You just add stuff / drag objects around and then optionally review the code after..
View Replies
View Related
Oct 16, 2014
Find the error log here ......
[pccbuildmgr@svl-jbuild-d1 Logical_Versioning]$ java -jar VersionUpdate1.jar
Picked up _JAVA_OPTIONS: -Xmx10g -XX:MaxPermSize=10g
can get the values for 1.0
java.net.UnknownHostException: home
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
[Code] ....
View Replies
View Related
Nov 25, 2014
I am trying to figure out the best way to load localized versions of FXML content. I know that I can localize strings, images etc. by specifying a ResourceBundle when loading the FXML using FXMLLoader with a ResourceBundle. But what about if you need to tweak the FXML for different locales (eg, adding more real estate for certain elements, different fonts, etc). Is there any way to create localized versions of FXML content? The only thing I can come up with is a naming convention like MyForm.fxml, MyForm_de_DE.fxml, ... and trying to load them based on the locale, but I'd have to come up with my own fallback for specific locales that aren't found.
View Replies
View Related
Nov 23, 2014
I'm getting back into the swing of things with Java after using I'm asked to utilize a simple GUI in order to take in the starting data, I cannot seem to get this to work. I'm getting this error Exception in thread "main" java.lang.NullPointerException
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at Input.buildPanel(Input.java:53)
at Input.<init>(Input.java:27)
at InputDemo.main(InputDemo.java:5)
I've created two classes
import javax.swing.*;
public class Input extends JFrame {
private JPanel panel;
private JLabel messageLabel;
private JLabel messageLabel1;
private JLabel messageLabel2;
private JTextField shiftHrs;
[code]....
View Replies
View Related
Feb 11, 2014
i have a program in UNIX directory /home/me/java/src
package bin;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
I have manage to compile it successfully(class file will be in bin directory) using command below: javac -d /home/t_bmf/java/bin HelloWorld.java
My problem now is how would I execute the class in bin directory in UNIX? I already tried different ways on how to execute it as suggested in my internet research The one I tried is this:
java $CLASSPATH:.:bin/HelloWorld
but I got this error message:
Exception in thread "main" java.lang.NoClassDefFoundError: :/:bin/HelloWorld
Caused by: java.lang.ClassNotFoundException: :.:bin.HelloWorld
[code]....
View Replies
View Related
May 28, 2014
I am trying to run my program through netbeans and I get a message:
...build-impl.xml:1048 the module has not been deployed.
see the server log for details.
The corresponding line in the xml document is:
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
And in the server log there is a long list of comments, the first which looks to be of significance to this issue is:
WARNING [http-apr-8080-exec-57] org.apache.catalina.deploy.NamingResourcesImpl.cle anUp Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/transBoard]] so no cleanup was performed for that container
javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].
There are others further down the list which might also be significant such as:
SEVERE [http-apr-8080-exec-59] org.apache.catalina.core.ContainerBase.addChildInt ernal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/transBoard]]
The corresponding line of code for the first warning that I listed is for the DataSource object and I wrote it as follows:
dataSource = (DataSource)
ic.lookup("java:/comp/env/jdbc/trans_board");
I'm pretty sure the issue has something to do with connecting to the database since it ran fine before I added the database related code.
View Replies
View Related
Aug 9, 2014
I had some questions about a theoretical java program. Say you had a java program on a linux server/pc that referenced a folder on that server. And say you had a Client PC (Windows) that had a share folder to that java program.
If that windows client PC tried to run the program would it run (with a GUI if it had one) and would the main directory of the java program still be on the linux server or would it be on the windows computer since that is the computer that is running the program?
Basically I have a program I am trying to find the best way to run it remotely on a windows computer but it references files on the linux server it is located at and needs to put files it creates there as well. I am just trying to make sure I understand my theory here on how the program will run if it IS run remotely.
View Replies
View Related
Mar 22, 2014
I made a software using Netbeans and javaswing. Accidently i deleted my main file which contains my main class and main method. Just to test, i tried to compile and run and it worked but the style of my buttons and windows has changed. So, what happened? How can i change the style of my programs?
//File Accidently deleted
package time;
public class Time {
public static void main( String[] args ) {
Window wdow = new Window();
wdow.setVisible( true );
}
}
View Replies
View Related
May 29, 2014
I am trying to run my program through netbeans and I get a message: build-impl.xml:1048 the module has not been deployed. see the server log for details.The corresponding line in the xml document is:
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
And in the server log there is a long list of comments, the first which looks to be of significance to this issue is:
WARNING [http-apr-8080-exec-57] org.apache.catalina.deploy.NamingResourcesImpl.cleanUp Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/transBoard]] so no cleanup was performed for that container
javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].
There are others further down the list which might also be significant such as:
SEVERE [http-apr-8080-exec-59] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/transBoard]]
The corresponding line of code for the first warning that I listed is for the DataSource object and I wrote it as follows:
dataSource = (DataSource)
ic.lookup("java:/comp/env/jdbc/trans_board");
the issue has something to do with connecting to the database since it ran fine before I added the database related code.
update: my server.xml file is as follows:
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
[code]....
View Replies
View Related
Feb 27, 2014
I have a program that is a XML-parser, and it works fine when I'm running it from NetBeans. But when I create a JAR-file and run the very same program, it cannot find the xml file. Consider this small program that addresses my problem:
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
[Code] .....
View Replies
View Related
Nov 16, 2014
I was doing some exercises of a java tutorial website, and realized when I ran the code that they had , my program just kept running with no result, why is this? It just hangs.
package mystack;
public class MyStack {
private int maxSize;
private int[] stackArray;
private int top;
public MyStack(int s)
[Code] ....
View Replies
View Related
May 19, 2014
This is my program: RemoteXMLRead.java
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.apache.commons.io.filefilter.WildcardFileFilte r;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import java.io.File;
[code]....
It is working fine when i run in Eclipse, but is giving error when i run in cmd.. What i need to do to over come this..
View Replies
View Related
Apr 16, 2014
Can we cance/stop a long running database query execution instantly so that we can do any another task.
As i know swing uses a single thread i,e Event Dispatch Thread (EDT), But at the same time we can use Swingworker class for better use of UI. When we use Swingworker class the process goes to a different thread and our basic UI is not Frozen. Infact we can do another task. But what I want is I want to stop of cancel the execution of swingworker thread ( Because I that thread takes long time to execute). How can I do that??
I used ProgressMonitor and in the cancel option i canceled the task ( worker.cancel(true) also i closed the connection and statement for executing the database query using stmt.close() and conn.close() methods.
But it does not work. How to cancel a long running database background process in a Java Swing Program.
View Replies
View Related
Mar 30, 2014
I've been playing around with this for about an hour.
Java Code:
Runtime runTime = Runtime.getRuntime();
try {
Process process = runTime.exec("notepad");
} catch (IOException e) {
e.printStackTrace();
} mh_sh_highlight_all('java');
So that works. Notepad will open.
However, I'm trying to get other programs to open. Specifically, this program: C:Octave3.2.4_gcc-4.4.0inoctave-3.2.4.exe...However, using that in place of notepad doesn't work. I'm assuming that there is some sort of system variable that explains why simply typing "notepad" works? As if you type notepad into the run box, notepad will open. Soo does that snippet work by going through some sort of system variables?How would I go about opening other programs, such as the one I referenced above.
View Replies
View Related
Nov 12, 2014
I have built a Java app that uses SQLite (sqlite-jdbc-3.8.7.jar). Running the jar file on windows works as expected however, trying to run it on Ubuntu Server 14.04 has turned into quite a task!
I put together a brand new machine in VirtualBox for testing. I installed Java (sudo apt-get install default-jre) and have installed SQLite (sudo apt-get install cl-sql-sqlite3 sqlitebrowser). I created a new sub-directory within my home directory and copied over the jar file. From terminal, I then run the command: sudo java -jar ProductionView.jar and I receive a java.lang.unsatisfiedlinkerror. For troubleshooting, within the app, before making a connection to the db, I have printed out the location of where the db is to be created and it is correct (see attached pic). Is there more that needs to be configured before I can run this app on Ubuntu? I have posted the relevant code below :
(AppDatabasePath() is what is printed in the image...).
public static String AppDatabasePath() {
return AppPath() + APP_NAME + ".db";
}
public static String AppDatabase() {
return "jdbc:sqlite:" + AppDatabasePath();
[Code] .....
View Replies
View Related
Mar 27, 2014
I am just learning Java and I am have a problem running programs at the command line. I have the following code:
package java_help;
import java.io.IOException;
class help {
[Code].....
I can run this program in net beans were I originally wrote the program and it runs fine there. I also compile the program at the command line using javac but when I go to run this program I get a error message that it cant find main.
View Replies
View Related
Mar 10, 2014
i have windows 7. cmd.exe told me it couldn't recognize javac.i have a JDK installed though...
View Replies
View Related
Dec 17, 2011
My PC runs on Windows XP. When I try to run a java program (written using NetBeans) from the command prompt, the program opens in NotePad but does not run.This is what I have been typing at the command prompt:
C:javahellosrchelloHello.java
The above is the correct path to the Java file on my PC.how to run the program from the command prompt or perhaps link me to a tutorial that explains it?
View Replies
View Related