Java compile on Ubuntu with openjdk, then run on windows with sun java gives error - netbeans

I have been developing a Java program in Netbeans/Ubuntu 12.04 using OpenJdk. I have got this program to run successfully using the .jar in Linux, but when I copy the .jar to my Windows 7 virtual machine I get the following error;
"Could not find the main class: testprogram.Main. Program will exit."
Also this program uses no external libraries.

How did you start your program? Did you use java -jar yourjarfile.jar?
Maybe your Manifest file does not defined applycation entry point. You can study this topic here.

My fix to this problem was to use JDK 6 as opposed to JDK 7, still unsure as to why this error was produced, but this change has fixed the problem.

Related

Running MALLET on Windows; could not find or load main class cc.mallet.classify.tui.Text2Vectors

I'm trying to get MALLET running on a 64-bit Windows 10 Enterprise machine from the native command prompt (cmd.exe). (I tried doing everything with Git Bash, but got stuck even earlier in the process.)
What I've done:
Installed JDK 8u281 for 64-bit Windows
Downloaded and installed MALLET 2.0.8 in my C:\
Installed Apache Ant in my C:\Program Files (per this Medium post)
Created new environmental variables
Adjusted my path
Run ant within the MALLET folder (received BUILD SUCCESSFUL)
Run ant jar within the MALLET folder (received BUILD SUCCESSFUL)
Typed bin\mallet, which displays the MALLET commands
However, when I tried to create a .mallet file, using bin\mallet import-dir, I get the error message Error: Could not find or load main class cc.mallet.classify.tui.Text2Vectors.
I (and my students) will appreciate any help in figuring out how to get this running.
This looks like a classpath issue. I'm not sure how Java on Windows handles classpath now. Try setting %MALLET_HOME% to C:\Mallet-2.0.8, not the bin directory? The classes would be in %MALLET_HOME%\class also, perhaps try adding that to %PATH% or %CLASSPATH%?

pgAdmin 4 not starting on Windows 10 64bit

After a fresh install of postgres 9.6.0.1 for Windows 10 64bit I am not able to get pgAdmin 4 starting.
First it throws an fatal error message:
After OK, that message appears:
Is there anything wrong? because after OK - the program won't start.
What can I do to get pgadmin 4 running? What should I enter in Python Path and what in Application Path?
I have found now the problem, it was the Java installation on which pgadmin 4 depend heavily.
In Windows when installing Java 8 (Java SE in this case) you do not have to use JAVA_HOME and JAVA_JRE anylonger and you can install java with default path settings (with the version number)
So I installed JAVA SDK 8 32 and 64bit and pgadmin start up normally.
The PATH variable includes only C:\ProgramData\Oracle\Java\javapath, thats all and let you use allways the latest version of java you installed.
In my case, I installed pgAdmin 4 v4.25 (released Aug. 20, 2020) . It solved my issue .
I had the same problem. I think, the installation of Visual C++ 2013 Redistributable is the source.
I fixed it uninstalling pgAdmin 4 and installing it again.
It tried to install Visual C++ 2013 Redistributable again, but it was already installed and now it works.
Hope this helps.
Try to install pgamin 4.5.1, it works for me (w10 x64) pgadmin 4.1.5
After struggling for weeks with this problem I found a solution. In my case I have Anaconda installed and maybe it affects PgAdmin in some way, I don't know. In order to start PgAdmin I followed these steps:
Open cmd and move to C:\Program Files\PostgreSQL\11\pgAdmin 4\web
Run pgAdmin4.py with your Python distribution. I had to install several libraries.
In my case, an error appeared, I needed to change Line #32 of C:\Program Files\PostgreSQL\11\pgAdmin 4\web\pgadmin\browser\__init__.py. More precisely:
from flask_security.views import _security, _commit, default_render_json, _ctx to
from flask_security.views import _security, _commit, _render_json, _ctx
Last, I needed to edited line socket module from Python libraries, gethostbyaddr(name) found non-ASCII symbols in the host name of my computer, I don't have any of them :S. Well, I changed line #687
hostname, aliases, ipaddrs = gethostbyaddr(name) to
hostname, aliases, ipaddrs = gethostbyaddr("")
After all of these steps I run pgAdmin4.py again and it worked.
Hope it helps.
For me there was no way to make it work (pgAdmin4 Version 4.21 that comes with Postgres 11.8 on Windows 10 x64). I really tried every possible solution.
So I gave up and found pgAdmin3 Redux: https://tokavuh.com/pgAdmin3Redux/ that supports Postgres 11, too.
You will probably have problems starting it, because of missing dll's from some Visual C++ Redistributable version I could not find out, but fortunately you will find these missing dll's on https://www.dll-files.com, just search them there as errors pops up.

Atg dyn exception

I face the below error while trying to run http://localhost:7103/dyn/admin/
atg 10.1.2 on windows 7 dyn/admin
The detailed exception is: java.io.IOException:
Cannot run program "javac": CreateProcess error=87,
The parameter is incorrect
this appear because windows has limitation on command parameter lenght
please advice how to solve this issue.
According to the ATG Support site:
Oracle Commerce ATG will convert JHTML pages into Java servlets and
then compile them into class files using the javac Java compiler. By
default, the javac executable is invoked to perform the page
compilation.
These errors point to a low level problem invoking the javac compiler. error=87 is mainly a problem on WebLogic 12 which has many different libraries in deeply nested directories.
The solution (which works for me on ATG11.1 and Weblogic 12.1.3) is
Edit or create the files
<ATG_Home>/localconfig/atg/dynamo/servlet/pagecompile/PageProcessor.properties
<ATG_Home>/localconfig/atg/dynamo/servlet/pagecompile/ExtendedJhtmlPageProcessor.properties
(I prefer to create them in an <ATG_Data>/servers/<servername>/localconfig/... folder but not sure of your setup)
Add these lines to the created above.
# Use java's internal compiler - only use this when using Oracle's JVM.
javaCompilerClassName=atg.servlet.pagecompile.SunJavaSourceCompiler

Cannot start Weblogic Server from Eclipse

I'm using Eclipse Kepler with Oracle Weblogic Tool plugin and I faced with this problem:
Trying to starting WLS server (both in Run/Debug mode) the process hangs at 23%.
It seams that Eclipse does not run startWeblogic.cmd file. I put into this cmd an instruction (as first instruction) that creates a tmp file on the fly, in order to understand if Eclipse is able or not to run the .cmd file.
Well, the file is not created. No possibility to:
Stop the process
Remove the Server from the list
OS: Win 7 64bit
Eclipse: any version (I tried also with Kepler)
WLS: 10.3.4
Any suggestion?
I found the solution by my self.
Qualcomm Atheros AWiC Diagnosiccs utility blocks the CMD. After that I killed the process (AWiCDiag,exe - I noted that it eat up 3.5 GB of memory) automagically Starting WLS process reached 100% in few second.

Eclipse error: Java started exit code=1

I just downloaded the Eclipse Classic from Eclipse.org but when I open it, I get this error message:
I'am using Windows 7 64-bit (and I also downloaded the windows7-64bit version)
"Mapper" means Folders in danish btw.
Check if your JRE/JKD is also 64 bit.